2013-05-01から1ヶ月間の記事一覧

SRM580 Div1 Easy(250) EelAndRabbit

EelAndRabbitそれぞれの鰻の頭の位置を試せば充分。 #include <vector> using namespace std; class EelAndRabbit{public: int getmax( vector <int> l, vector <int> t ) { int n = (int)l.size(); int ans = 0; for ( int i=0; i</int></int></vector>

SRM580

Easy (250) 188.92 Medium (600) 0 Hard (1000) 0 Challenge 0 結果 425位 1942→1885orz orz orz

SRM579 Div1 Hard(1000) MarblePositioning

MarblePositioningビー玉の個数が高々8個なので、全ての並び順を試してみれば良い。半径aと半径bのビー玉が接する距離は√((a+b)2-(a-b)2)。 #include <vector> #include <algorithm> #include <cmath> using namespace std; class MarblePositioning{public: double totalWidth( vector <int></int></cmath></algorithm></vector>…

SRM579 Div2 Easy(250) PrimalUnlicensedCreatures

PrimalUnlicensedCreatures #include <vector> using namespace std; class PrimalUnlicensedCreatures{public: int maxWins( int initialLevel, vector <int> grezPower ) { int level = initialLevel; for ( int c=0; ; c++ ) { int p = -1; for ( int i=0; i<(int)grez</int></vector>…

SRM579 Div1 Medium(450) TravellingPurchasingMan

TravellingPurchasingManbitDP。まず、先頭M店の全点対間最短路を求める。Mは高々16なので、行った店と現在いる店ごとに、その状態になる最も早い時刻を覚えておく。 #include <sstream> #include <string> #include <vector> using namespace std; int countbit( int n ) { int c=0; </vector></string></sstream>…

SRM579 Div1 Easy(250), Div2 Medium(550) UndoHistory

UndoHistory貪欲法。不要な文字をundoに作るくらいなら、必要なときに作れば良い。 #include <string> #include <vector> using namespace std; int pref( string a, string b ) { a += "!"; b += "?"; for ( int i=0; ; i++ ) if ( a[i]!=b[i] ) return i; return -1; } cla</vector></string>…

SRM579

Easy (250) 0 Medium (500) 0 Hard (1000) 0 Challenge 0 結果 563位 2105→1942orz orz orz

2013 TCO Round2C

Easy (250) 0 Medium (550) 0 Hard (1000) 0 Challenge +150 結果 332位 2141→2105250で最短距離dを求めた後に、d-1を答えにしている人がいて、チャレンジで150点稼いだ。Round3進出は無理でもTシャツを貰えるかもと思っていたら、自分の250が落ちた。何で最…

SRM578

Easy (250) 147.98 Medium (500) 253.52 Hard (1000) 0 Challenge 0 結果 91位 2130→2141