# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
518512 | tabr | Art Class (IOI13_artclass) | C++17 | 57 ms | 6020 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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]}) > 150) {
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |