SRM145 DIV2 250
文字列ditheredに含まれる文字が文字列の配列screenにいくつあるかを数える問題
(英文ではよく意味が分からずぐぐった)
普通にぐるぐる回しただけ
#include <string> #include <vector> using namespace std; class ImageDithering { public: int count(string dithered, vector <string> screen) { int i, j, k; int count = 0; for (i=0; i<screen.size(); i++) { for (j=0; j<screen[i].length(); j++) { for (k=0; k<dithered.length(); k++) { if (dithered[k] == screen[i][j]) { count++; } } } } return count; } };