Submission #575797

#TimeUsernameProblemLanguageResultExecution timeMemory
575797MazaalaiArt Class (IOI13_artclass)C++17
3 / 100
74 ms3264 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using VI = vector <ll>; ll r, g, b; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { for (int i = 0; i < 500; i++) for (int j = 0; j < 500; j++) { r += R[i][j]; g += G[i][j]; b += B[i][j]; } // cout << r << ' ' << g << ' ' << b << '\n'; if (g > r && r > b) return 2; map <VI, int> cnts; int maxi = 0; for (int j = 0; j < 500; j++) { ll rr, gg, bb; rr = gg = bb = 0; for (int i = 0; i < 500; i++) { rr += R[i][j]; gg += G[i][j]; bb += B[i][j]; } rr /= 5000; gg /= 5000; bb /= 5000; ++cnts[{rr, gg, bb}]; maxi = max(maxi, cnts[{rr, gg, bb}]); } if (maxi > 400) return 4; r /= 500 * 500 * 50; g /= 500 * 500 * 50; b /= 500 * 500 * 50; if (r == g && g == b) return 3; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...