2010-03-18から1日間の記事一覧
ColorfulStrings全探索。n≦50とあるが各桁の数字は全て異なるのでcolorfulな文字列の個数はそれほど多くない。 #include <string> #include <set> using namespace std; class ColorfulStrings { string BT( int n, int k, string s, int *c ); bool check( string s ); p</set></string>…
ColorfulBoxesAndBalls #include <algorithm> using namespace std; class ColorfulBoxesAndBalls { public: int getMaximum( int numRed, int numBlue, int onlyRed, int onlyBlue, int bothColors ); }; int ColorfulBoxesAndBalls::getMaximum( int numRed, int numB</algorithm>…
不参加。