2009-11-18から1日間の記事一覧

SRM453 Div2 Hard(1000) TheSoccerDivTwo

TheSoccerDivTwoチームをチーム0が順位で勝てないチーム、そのチームが負ければチーム0が勝てるチーム、そのチームが引き分ければチーム0が勝てるチーム、勝敗に関係無くチーム0が勝てるチームに分けて、g1, g2, g3, g4とする。なるべくg2が負けて、g3が引き…

SRM453 Div2 Medium(500) TheBasketballDivTwo

TheBasketballDivTwo #include <vector> #include <string> #include <algorithm> using namespace std; class TheBasketballDivTwo { int n; vector<string> t; int play( int p ); public: int find( vector<string> table ); }; int TheBasketballDivTwo::find( vector<string> table ) { n = (int)table.size</string></string></string></algorithm></string></vector>…

SRM453 Div2 Easy(250) TheTournamentDivTwo

TheTournamentDivTwo #include <vector> #include <numeric> using namespace std; class TheTournamentDivTwo { public: int find( vector<int> points ) { int sum = accumulate( points.begin(), points.end(), 0 ); return sum%2==0 ? sum/2 : -1; } };</int></numeric></vector>