2011-03-16から1日間の記事一覧

SRM464 div2 hard

拡張幅優先探索って言うのかな。知らないけど。 prob[y][x][visited]でBFSすると通る。 ビット演算で間違えた。 #include <string> #include <queue> #include <vector> using namespace std; class Q { public: int x,y,visited; double safe; }; class ColorfulMazeTwo { public: </vector></queue></string>…

SRM330 div2 hard

久しぶりにパズル的な問題が出たので手も足も出なかった (前半分 + 前半分をひっくり返したもの)もしくは (前半分+1 + 前半分+1をひっくり返したもの)が答え #include <algorithm> #include <string> #include <vector> using namespace std; class NextPalindromicNumber { p</vector></string></algorithm>…

SRM389 div2 hard

全探索で間に合う、難しさの計算も2^6通り全て試してよい #include <string> #include <sstream> #include <vector> using namespace std; class GuitarChords { public: vector<int> strings; vector<int> chord; vector<int> play; int sN,cN,ans,all; int s2i(string s) { if(s=="A") return 0; if</int></int></int></vector></sstream></string>…

SRM384 div2 hard

また落とした。もう眠いので解説は TopCoder Statistics ここ読んでください #include <cstdio> #include <string> #include <algorithm> using namespace std; class PowerGame { public: string winner(int size0, int size1) { int DP[10005]; for(int num=0;num<10005;num++) { if(n</algorithm></string></cstdio>…

合宿が中止になったみたいです。そもそも関係ないけど。