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

SRM146 DIV2 250

1〜6の数字が5つ入った配列から同じ数字の場合は合算し、最大の数字を取り出す #include <string> #include <vector> #include <map> using namespace std; class YahtzeeScore { public: int maxPoints(vector <int> toss) { map<int, int> score; int i, max; max = 0; for (i=0; i<5; i++) { s</int,></int></map></vector></string>…

SRM145 DIV2 250

文字列ditheredに含まれる文字が文字列の配列screenにいくつあるかを数える問題 (英文ではよく意味が分からずぐぐった)普通にぐるぐる回しただけ #include <string> #include <vector> using namespace std; class ImageDithering { public: int count(string dithered, vect</vector></string>…