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

SRM463 Div2 Easy(250) BunnyPuzzle

BunnyPuzzle #include <vector> using namespace std; class BunnyPuzzle { public: int theCount( vector <int> bunnies ); }; int BunnyPuzzle::theCount( vector <int> bunnies ) { int n = (int)bunnies.size(); int c = 0; for ( int i=0; i</int></int></vector>

SRM463 Div1 Easy(250), Div2 Medium(500) RabbitNumbering

RabbitNumbering例えば、ソートしたmaxNumberが{2,3,5,8}ならば、1番目の兎は2通り、2番目の兎は1番目の兎に付けた番号は使えないので3-1=2通り、3番目の兎は1,2番目の兎に付けた番号は使えないので5-2=3通りの選び方がある。 #include <vector> #include <algorithm> using nam</algorithm></vector>…

SRM463

Easy (250) 75.0long longで充分なのに多倍長が必要と思い込んで自前で実装、そして実装ミスって再提出。もったいない。Medium (500) 0解いている人はさっくり解いているけど、なんであの方法で良いのかわからない。Hard (1000) 0見てない。challenge +50Med…