2010-01-01から1年間の記事一覧

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参加者の皆さんの背中を見てきたからこその事です。ありがとうございます。とはいっても全然油断はできないのでさっそく…

日本情報オリンピック 第10回予選 自分の提出した解答

未だ正答は公表されていないので、あっているかどうかは分かりません。 じきに公開されると思います。JOI 2010-2011 予選 問題・採点用入力前年度の過去問にに比べれば難しい年だったと思うが、一昨年などより難しい年もあったようで、 問題も全体的にひっか…

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>…

o2maniaをCrossOver Games上で走らせるパッチを作る

o2maniaってなんだっけ? 今となっては存在していないけれどもその昔DJMAX Onlineというオンゲーの音ゲーがありまして、 そのデータを使ってゲームの曲をプレイできるエミュとか呼ばれる類の物がございまして…云々 という訳でその頃のデータがHDDの中に未だ眠…

情報オリンピック 第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>…

AOJ 0021 Parallelism

404 Not Found #include <cstdio> int main() { int n; scanf("%d\n", &n); for(int i = 0; i < n; i++){ double x1, y1, x2, y2, x3, y3, x4, y4; scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4); puts(((y1 - y2) / (x1 - x</cstdio>…

Dijkstraとか

一応アリ本で理解できたつもりだけど、はやく自分で実装できるようにならんと。読む ダイクストラ法(最短経路問題) 解く 404 Not Found 404 Not Found

AOJ 0515 School Road

404 Not Found #include <cstdio> #include <vector> using namespace std; int a, b; vector<vector<char> > v; int dfs(int x, int y){ int _x = x + 1, _y = y + 1, m = 0; if(_x < a && y < b){ if(v[_x][y] == 0) m += dfs(_x, y); } if(x < a && _y < b){ if(v[x][_y] == 0) m += df</vector<char></vector></cstdio>…

PKU 3253 Fence Repair

3253 -- Fence Repairなんか理解に少し時間を要したけど簡単な事だった。 要求された中で最も短い板2つを足して、コストに加算 それらの長さを足して1枚の板とする その1枚の長い板と、その他の板の中から、また再び最も短い板2つを足して…(以下続く) なんだ…

PKU 2431 Expedition

2431 -- Expedition #include <cstdio> #include <vector> #include <queue> #include <algorithm> using namespace std; int main() { int N; vector<pair<int, int> > v; scanf("%d\n", &N); for(int i = 0; i < N; i++){ int x, y; scanf("%d %d\n", &x, &y); v.push_back(make_pair(x, y)); } int L, P; sc</pair<int,></algorithm></queue></vector></cstdio>…

PKU 3069 Saruman's Army

3069 -- Saruman's Army情報オリンピックだって近いのに僕はこんな程度で大丈夫なんだろうか。 いや、全然大丈夫じゃないんだが。あと半月程度でどこまで伸びられるかが勝負だけれどもそんなに急に伸びる物とも思えんしなぁ… #include <cstdio> #include <vector> #include <algorithm> </algorithm></vector></cstdio>…

Ubuntu 10.04LTSでOSXのpbcopyみたいにTerminalからコマンドでクリップボードに物をコピー

xselを使う。 sudo apt-get install xsel あとは ls -la | xsel -i -b みたいな感じで。

ThinkPad X60s下のUbuntu 10.04 LTSで指紋認証を使う

なんか色々ところころ変わっているらしく若干混乱した。以下おおまかな流れ。 ThinkFingerのインストール % sudo apt-get install thinkfinger-tools libpam-thinkfinger 指紋の作成とテスト 3回指をスワイプしろと言われるので、言われた通りにする。 % sud…

PKU 3617 Best Cow Line

3617 -- Best Cow Line #include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int N; cin>>N; string s; for(int i = 0; i < N; i++){ char c; cin>>c;s += c; } string t, u; while(!s.empty()){ u = s; reverse(u.begin(), u.end()); if(u > s</algorithm></string></iostream>…

PKU 2386 Lake Counting

2386 -- Lake Countingアリ本もう一冊手に入れたので読み進めていく事にした。 #include <iostream> #include <vector> #include <string> using namespace std; bool inline validate(int x, int y, vector<string>& v){ return (0 <= x) && (x < v.size()) && (0 <= y) && (y < v[0].size());</string></string></vector></iostream>…

PKU 1051 P,MTHBGWB

1051 -- P,MTHBGWBモールス信号。 #include <iostream> #include <string> #include <map> #include <algorithm> using namespace std; inline void maketable(map<char, string>& enc, map<string, char>& dec){ const char *abc[] = { ".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-", ".-..","--","</string,></char,></algorithm></map></string></iostream>…

PKU 1068 Parencodings

1068 -- Parencodings #include <cstdio> #include <string> using namespace std; int main() { int t; scanf("%d\n", &t); for(int i = 0; i < t; i++){ int n; scanf("%d\n", &n); string s; for(int j = 0,lm = 0, m; j < n; j++){ scanf("%d", &m); s += string(m - lm,</string></cstdio>…

TopCoder SRM 486 DIV 2

197.12点。Rating: 598 -> 724 灰色なりにやっと初期の水準を回復してきた。次回でコケなければ緑に戻れるか? 250 Text Message 基本的に一発で書いて一発でテスト通して一発で提出したつもりだったのだが、案外と書くのに時間がかかってしまったせいで、200…

坂口安吾「堕落論」・「続堕落論」読了

図書カード:堕落論 図書カード:続堕落論 感想はまた何か機会があった時に、というのも今は中間テスト直前だからである。 そもそも本なぞ読んでいる場合ではないのだが。とりあえず、なかなか面白い話だと思った。とくに続堕落論の日本人の精神構造などは現…