2011-08-30から1日間の記事一覧

SRM516 Div2 Easy(250) NetworkXZeroOne

NetworkXZeroOneInteresting propertyを持つメッセージは、oxoxox……と、xoxoxo……。 #include <string> using namespace std; class NetworkXZeroOne{public: string reconstruct( string message ) { int n = (int)message.size(); string cand[2]; for ( int i=0; i</string>

SRM516 Div1 Medium(500) RowsOrdering

RowsOrderingExample 0の{"bb", "cb", "ca"}は、1番目cb、2番目bb、51番目caと並べるのが最善。これを、1列目によってcbの順位が+0、bbの順位が+1、caの順位が+0され、2列目によってcbの順位が+0, bbの順位が+0、caの順位が+50されると考える。そうすると、…

SRM516 Div1 Easy(250), Div2 Medium(500) NetworkXOneTimePad

NetworkXOneTimePad鍵の候補は、cipher[0]^plain[0], cipher[0]^plain[1], cipher[0]^plain[2], ……。平文が全て異なるという問題の制約から、この鍵の候補も全て異なる。このなかで全ての暗号文に平文が存在するものを数える。 #include <string> #include <vector> #include <algorithm></algorithm></vector></string>…

SRM516

Easy (250) 200.40 Medium (500) 303.14 Hard (1000) 0 Challenge 0 結果 51位 1949→2048テストケース弱すぎw そのおかげかシステムテストで一気に順位が上がって自己ベスト更新。善哉善哉。