2010-03-18から1日間の記事一覧

SRM464 Div1 Easy(250), Div2 Medium(500) ColorfulStrings

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>…

SRM464 Div2 Easy(250) ColorfulBoxesAndBalls

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>…

SRM464

不参加。