2011-02-19から1日間の記事一覧

SRM323 div2 hard

全探索、AとBしか使わないんじゃねと思ったので思い切って書いてみたらあたった 怖かった 実際はもうちょっと文字を使う、ダメだ俺 #include <string> #include <vector> #include <cstring> #include <iostream> using namespace std; class UnrepeatableWords { public: int k,n,allowed; stri</iostream></cstring></vector></string>…

SRM328 div2 hard

DP苦手だからメモ化再帰 #include <map> #include <string> #include <sstream> #include <vector> #include <cstring> using namespace std; typedef pair<bool,vector<string> > KEY; class ScoreDifference { public: int board[4][4]; int cache[2][(1<<16)]; int ABS(int num) { return num<0 ? -num : num; } bool </bool,vector<string></cstring></vector></sstream></string></map>…