2013-06-27から1日間の記事一覧

10404:Bachet's Game

問題文 http://uva.onlinejudge.org/external/104/10404.htmlStanとOllieが石をnum[ i ]個ずつ取っていって最後のひとつを取ったほうが勝ち。どちらが勝つか判定せよ。 蟻本4-2章そのまま。解きなおした。 dp[ 残っている石の個数 ] := 勝敗dp[ 0 ] = 負け d…

10503:The dominoes solitaire

問題文 http://uva.onlinejudge.org/external/105/10503.html無向グラフが与えられる。スタートからゴールまでちょうどn回のステップで行くことができるか判定せよ。 全探索した。 #include<set> #include<iostream> #include<vector> #include<algorithm> #include<string> #define f first #define s </string></algorithm></vector></iostream></set>…

11665:Chinese Ink

問題文 http://uva.onlinejudge.org/external/116/11665.htmlいくつかの多角形(凸とは限らない)を墨で塗りつぶしたときいくつの多角形ができるか求めよ。 点-多角形包含判定。本番はライブラリが間違ってたらしく通せなかった。spaghetti sourceさんを参考に…