Submission #518517

#TimeUsernameProblemLanguageResultExecution timeMemory
518517tabrArt Class (IOI13_artclass)C++17
4 / 100
66 ms3432 KiB
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif #ifndef tabr #include "artclass.h" #endif int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) { int cnt = 0; int rs = 0; int gs = 0; int bs = 0; int ws = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w - 1; j++) { rs += r[i][j]; gs += g[i][j]; bs += b[i][j]; if (min({r[i][j], g[i][j], b[i][j]}) < 50) { ws++; } int dr = abs(r[i][j] - r[i][j + 1]); int dg = abs(g[i][j] - g[i][j + 1]); int db = abs(b[i][j] - b[i][j + 1]); if (min({dr, dg, db}) > 50) { cnt++; } } } int x = h * w; if (cnt > x / 10) { if (gs > 100 * x && 150 * x > max(rs, bs)) { return 2; } else { return 3; } } else { if (ws > x / 10) { return 1; } else { return 4; } } } #ifdef tabr int main() { ios::sync_with_stdio(false); cin.tie(0); return 0; } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...