2012-03-22から1日間の記事一覧

AOJ_2273 Shiritori

問題 解法 対話型プログラムを書く変わった問題。おもしろい。AIの単語をsetを使って記録しておく。 自分の言う言葉の生成方法はいろいろあるが、bitで管理することにした。 具体的には以下変数iを用意して0で初期化する。 (1) i++; (2) 単語生成 1文字め…AI…

AOJ_0525 Osenbei

AOJ

問題 解法 解説みた。 縦の列はたかだか10列しかないので縦の反転をすべて試していく。 #include <cstdio> #include <algorithm> using namespace std; const int MAX_R = 10, MAX_C = 10000; int R, C; int senbei[MAX_R][MAX_C]; int count(){ int f, b; int res = 0; for(int</algorithm></cstdio>…