UVa

#147 http://acm.uva.es/p/v1/147.html

UVa

久々に。放置してたコードを見てみたらコインの種類が1つ足りてなかった。。

#128 http://acm.uva.es/p/v1/128.html

UVa

昔Compile Errorの理由が分からなくて放置してたやつ。UVaのシステムが変わってて、Compile Errorが出たときはエラーメッセージをメールで送り付けてくれる。これ便利。

#146 http://acm.uva.es/p/v1/146.html

UVa

STLで文字列を逆順にするのってどうするんだろうなぁ。

#145 http://acm.uva.es/p/v1/145.html

UVa

小数点以下を2桁に揃えて出力するには、 #include <iostream> #include <iomanip> using namespace std; ... cout << setiosflags(ios::fixed) << setprecision(2) << x;とやる。</iomanip></iostream>

#144 http://acm.uva.es/p/v1/144.html

UVa

こんなコード書いてたんじゃ使いものにならないなぁと思いつつ。

#142 http://acm.uva.es/p/v1/142.html

UVa

問題文をよく読もう。

#141 http://acm.uva.es/p/v1/141.html

UVa

動的に二次元配列を作るには vector< vector<bool> > board(n, vector<bool>(n, false));でOKらしい。この書き方したらboard[i]が全部同一のものになると勝手に思い込んでた…。</bool></bool>

#138 http://acm.uva.es/p/v1/138.html

UVa

順調に図形問題を飛ばしてるな。問題の意味が最初分からなかったけど、"6 8"の例の場合、 1 2 3 4 5 [6] 7 8 6番の家から左に数を足していった場合と右に足していった時の合計が同じになる。(1 + 2 + 3 + 4 + 5 = 7 + 8)こんな組を10組求めろ、ってやつ。素…

#136 http://acm.uva.es/p/v1/136.html

UVa

Hammingの問題そのまんまらしい。全然覚えてなかったけど。google:Hammingの問題

#133 http://acm.uva.es/p/v1/133.html

UVa

普通の問題。C++erならイテレータとかでやっちゃうのかもしれないけど。

#126 http://acm.uva.es/p/v1/126.html

UVa

Sample Outputを見ただけでやる気がなくなる。で、頑張ってみたけどPresentation Error.もう無理。

#124 http://acm.uva.es/p/v1/124.html

UVa

Lexicographical orderに気をつけろ

#122 http://acm.uva.es/p/v1/122.html

UVa

Binary Heapを作るだけ…のはずが入力で不手際があったらしくRuntime Errorとかでてこずった。

#129 http://acm.uva.es/p/v1/129.html

UVa

(Presentation Error) 未だにコーディング速度遅いなぁ。

#125 http://online-judge.uva.es/p/v1/125.html

UVa

最初はPresentation Error. PEは無視する方針だけど、なんとなくOutputから行末のスペース削除したらAcceptされた。面倒だなぁ。

#101 http://online-judge.uva.es/p/v1/101.html

UVa

#110 http://online-judge.uva.es/p/v1/110.html

UVa

頭痛い。

#121 http://online-judge.uva.es/p/v1/121.html

UVa

"適当な"inputを自分で考えられるようにならなきゃ。

#123 http://online-judge.uva.es/p/v1/123.html

UVa

(Presentation Error) #122がRuntime Error起こしてどうにも分からないので息抜き。

#120 http://online-judge.uva.es/p/v1/120.html

UVa

break忘れ。

#119 http://online-judge.uva.es/p/v1/119.html

UVa

(Presentation Error)

#118 http://online-judge.uva.es/p/v1/118.html

UVa

MingWのg++は #include <string>と書かなくてもstringが使えてしまってCompile Errorではまる。今回は使わなかったけどINT_MAX,INT_MINを使うような場合はclimitsをインクルードする。</string>

#116 http://online-judge.uva.es/p/v1/116.html

UVa

lexicographically smallestな解が求められてるのに気付くまで時間がかかった。

#107 http://online-judge.uva.es/p/v1/107.html

UVa

問題の検討が致命的に足りない。

#112 http://acm.uva.es/p/v1/112.html

UVa

iostreamで50分くらい躓いてた。要勉強。

#108 http://acm.uva.es/p/v1/108.html, #111 http://acm.uva.es/p/v1/111.html

UVa

初の一発Accept達成。

#115 http://acm.uva.es/p/v1/115.html

UVa

アルゴリズムとか要らないやつ解いても糧にならんのじゃないか?…と思う。