Programming

TopCoder SRM 498 DIV2

Rating: 883→894(灰) 400.41 Pointsとりあえず上がったので良かった。 全体としては、コーディング速度の壁に一つブチ当たったような気もする。 250: AdditionGame 実装に迷ってしまって、最初vector→めんどい→set→「あ、違ぇや」などの流れを踏んだ結果、非…

TopCoder SRM 497 DIV2

Rating: 892→883(灰) 167.02 Points 250: Filtering ソートとかに迷いが生じてSubmitがすごい遅くなった。 167.02 Points #include <vector> #include <string> #include <algorithm> #include <map> using namespace std; class Filtering { public: vector <int> designFilter(vector <int> sizes, st</int></int></map></algorithm></string></vector>…

AOJ 0191 Baby Tree

404 Not Found やっとまともにDP解けたー!!!!!(嬉) #include <cstdio> #include <algorithm> using namespace std; int main() { int n, m; while(scanf("%d %d\n", &n, &m), n || m){ long double g[n][n]; /* dp[a][b]は、a回目にbの肥料を与えた時のaまでの成長率の最大値 */</algorithm></cstdio>…

AOJ 2216 Summer of KMC

404 Not Found #include <cstdio> int main() { int A, B; while(scanf("%d %d\n", &A, &B), A || B){ int hyak = 0, gohyak = 0, sen = 0; int x = B - A; if(1000 <= x){ sen = x / 1000; x %= 1000; } if(500 <= x){ gohyak = x / 500; x %= 500; } if(100 <= x){</cstdio>…

Codeforces Beta Round #54 (Div. 2)

A. Chat room #include <iostream> #include <string> using namespace std; int main() { string s, t("hello"); cin>>s; int cnt = 0; for(int i = 0; i < s.size(); i++){ if(cnt >= t.size()) break; if(s[i] == t[cnt]){ cnt++; } } cout<<(cnt >= t.size() ? "YES" : "NO</string></iostream>…

TopCoder SRM 496 DIV2

Rating: 654→892(灰) 前が酷かったので上がってもまだ灰色コーダーだけれども、大分一気に上がった。Total: 698.3 points 250: AnagramFree 239.97 points #include <map> #include <string> #include <vector> using namespace std; class AnagramFree { public: int getMaximumS</vector></string></map>…

JOI過去問未solved一覧

×:実装方法分からず ?:実装したけどアルゴリズム分からず △:実装したけどバグとれず ○:Solved 無印:ノンタッチ 第5回 予選 ×AIZU ONLINE JUDGE ×AIZU ONLINE JUDGE 本選 ×AIZU ONLINE JUDGE ×AIZU ONLINE JUDGE 第6回 本選 △AIZU ONLINE JUDGE △AIZU O…

日本情報オリンピック 第8回本選

JOI 2008-2009 本選 問題・データ 1. IOIOI 404 Not Found #include <iostream> #include <string> #include <vector> using namespace std; int main() { long long n; while(cin>>n, n){ long long m; string s; cin>>m>>s; n = 2 * n + 1; vector<long long> v; int len = 0; bool is_seq = 0; </long></vector></string></iostream>…

日本情報オリンピック 第7回本選

JOI 2007-2008 本選 問題・データ 1. 碁石ならべ 何故かWAする。たしかにテストケースに対する答え見ると違う。なんでだろう。問題を理解できてないのかなあ…見た通り実装した筈なんだが… 2. 共通部分文字列 Longest Common Subsequenceではない。Longest Co…

日本情報オリンピック 第6回本選

JOI 2006-2007 本選 問題・データ 1. 最大の和 404 Not Found #include <cstdio> #include <vector> #include <climits> using namespace std; int main(){ int n, k; while(scanf("%d %d\n", &n, &k), n || k){ vector<int> v(n); for(int i = 0; i < n; i++) scanf("%d\n", &v[i]); int S</int></climits></vector></cstdio>…

日本情報オリンピック 第5回本選

JOI 2006 本選 問題・データ 1. Questionnaire 404 Not Found #include <cstdio> #include <map> #include <set> #include <vector> using namespace std; int main() { int n, m; while(scanf("%d %d\n", &n, &m), n || m){ map<int, int> ma; for(int i = 0; i < n; i++){ for(int j = 0, x; j </int,></vector></set></map></cstdio>…

Project Euler Problem 3

Problem 3 - Project Euler コード #include <cstdio> long long lpf(long long x){ long long maximum = 0; while(x != 1){ for(long long i = 2; ; i++){ if(!(x % i)){ x /= i; maximum = i; break; } } } return maximum; } int main() { printf("%lld\n", lpf(6</cstdio>…

Project Euler Problem 2

Problem 2 - Project Euler コード #include <cstdio> int main() { unsigned long long Fa = 0, Fb = 1, Fsum = 0; while(Fb < 4000000){ if(!(Fb % 2)) Fsum += Fb; Fa ^= Fb; Fb ^= Fa; Fa ^= Fb; Fb += Fa; } printf("%lld\n", Fsum); return 0; } 答え 4613732</cstdio>…

Project Euler Problem 6

コード #include <cstdio> inline long long sq(long long x){ return x * x; } int main() { long long a = 0, b = 0; for(int i = 1; i <= 100; i++) a += sq(i); for(int i = 1; i <= 100; i++) b += i; b = sq(b); printf("%lld\n", b - a); return 0; } 答え 25</cstdio>…

Project Euler Problem 5

コード #include <cstdio> #include <algorithm> using namespace std; #define lcm(a,b) (a/__gcd(a,b)*b) int main() { int result = 1; for(int i = 2; i <= 20; i++){ result = lcm(result, i); } printf("%d\n", result); return 0; } 答え 232792560LCMのマクロはid:kyuri</algorithm></cstdio>…

Project Euler Problem 4

Problem 4 - Project Euler コード #include <cstdio> #include <sstream> #include <algorithm> using namespace std; bool is_parlindrome(int x){ stringstream ss; ss<</algorithm></sstream></cstdio>

POJ 1005 I Think I Need a Houseboat

1005 -- I Think I Need a Houseboat #include <cstdio> #include <cmath> int main() { int N; const double pi = 3.1415; scanf("%d\n", &N); for(int i = 0; i < N; i++){ double X, Y; scanf("%lf %lf\n", &X, &Y); double a = sqrt(X*X + Y*Y); for(int j = 0; ; j++){</cmath></cstdio>…

You asked me to pull without telling me which branch you(略)って言われた時にする事

githubなんかでgit initした側で(git cloneした側以外で)、git pullしようとすると、そんな感じで怒られたりする。以下を呪文のように打っておくとどうにかなる、らしい。 % git config branch.master.merge refs/heads/master % git config branch.master.r…

日本情報オリンピック第10回 予選通過しました

予選は80点でAランクでした。解けなかったのは4番と6番。それでもどうにか通過できました。一安心。 これも周囲でがんばっていた他のJOI参加者の皆さんの背中を見てきたからこその事です。ありがとうございます。とはいっても全然油断はできないのでさっそく…

SKKの接尾辞機能

SKK辞書を眺めていて知った話だが、SKKには接尾辞変換という機能があるらしい。SKK by javascript: メモ SKK では「変換直後」で(あるいは上のように確定キーを押すかわりに)「>」を押すと、接尾辞変換モードとなる。 へえ、1年程度SKK使いをやっているが、…

JOI予選過去問 解けなかった問題、まだ解いていない問題

要デバッグ 第9回 6. 方向音痴のトナカイ AOJ 0548 Reindeer with no sense of direction 第8回 4. 薄氷渡り AOJ 0535 Crossing Black Ice 第5回模試1 3. Two Number Cards 第5回模試2 1. Tunnel 解説を読んでアルゴリズムを理解しないといけない 第8回 5. …

情報オリンピック 第5回模擬試験1, 2

模擬試験の問題はJOIにはありません。ので、手元で一応確認したものの間違ってる可能性も。 オーダーとか何それって感じ。 情報オリンピック 第5回模擬試験1 JOI 2006 模擬試験1 問題・データ 1. Triangle Types #include <cstdio> #include <vector> #include <algorithm> using names</algorithm></vector></cstdio>…

JOI予選過去問解けなかった物(2010/12/16 12:00時点)

(Total Progress: 4 / 10) 第9回 6. 方向音痴のトナカイ AOJ 0548 Reindeer with no sense of direction 404 Not Foundどこから手をつけていいかすら分からない。 実際ヒント見るとそんなに難しくはない。けど何故かTLE→Runtime Error。えーそんなー。ところ…

情報オリンピック 第5回予選問題

JOI 2006 予選 問題・データ 1. AOJ 0500 Card Game 404 Not Found 時間があったらまた解く。 2. AOJ 0501 Data Conversion 404 Not Found AOJ 0501 Data Conversion - ペリャウドのプログラミングとか 時間があったらまた解く。 3. AOJ 0502 Dice 404 Not F…

情報オリンピック 第7回予選問題

JOI 2007-2008 予選 問題・データ 1. おつり AOJ 0521 Change AIZU ONLINE JUDGE #include <cstdio> int count(int x){ int coins = 0; while(x >= 500) coins++, x -= 500; while(x >= 100) coins++, x -= 100; while(x >= 50) coins++, x -= 50; while(x >= 10) co</cstdio>…

情報オリンピック 第8回予選問題

JOI 2008-2009 予選 問題・データ 1. タイムカード AOJ 0532 Time Card 404 Not Found #include <cstdio> class Time { public: int h, m, s; void read(){ scanf("%d %d %d\n", &h, &m, &s); return; } long long totalsec(){ return h*60*60 + m*60 + s; } static </cstdio>…

情報オリンピック 第6回予選問題

JOI 2006-2007 予選 問題・データ 1. 得点 AOJ 0510 Score 404 Not Found #include <cstdio> #include <algorithm> using namespace std; int main() { int A = 0, B = 0; for(int i = 0, t; i < 4; i++) scanf("%d\n", &t), A += t; for(int i = 0, t; i < 4; i++) scanf("%d\n</algorithm></cstdio>…

情報オリンピック 第9回予選問題

JOI対策の一環で解いた。AOJ in JOI,PCK 回別リスト - 簡潔なQ ありがてえありがてえqnighyさんありがとうございます。 AOJ 0543 Receipt 404 Not Found #include <cstdio> int main() { int total; while(scanf("%d\n", &total), total){ int others = 0; for(int i</cstdio>…

AOJ 0117 A Reward for a Carpenter

404 Not Found #include <cstdio> #include <vector> #include <queue> #include <climits> using namespace std; class E { public: int to, cost; E(int to, int cost){ this->to = to; this->cost = cost; } }; class P { public: int cost, node; P(int cost, int node){ this->cost = co</climits></queue></vector></cstdio>…

AOJ 0526 Boat Travel

404 Not Found #include <cstdio> #include <vector> #include <queue> #include <climits> using namespace std; class E { public: int to, cost; E(int to, int cost){this->to = to;this->cost = cost;} }; class Pr { public: int cost, edge; Pr(int cost, int edge){this->cost = cost</climits></queue></vector></cstdio>…