# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305770 | Temmie | Art Class (IOI13_artclass) | C++17 | 448 ms | 8312 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>
#include "artclass.h"
typedef long long ll;
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
std::vector <ll> cnt(255 * 255 * 3 + 69420, 0);
ll sum = 0, sq = 0, tmp = 0, mid = 0;
for (int i = 15; i < h - 15; i++) for (int j = 15; j < w - 15; j++) for (int ii = i; ii < i + 15; ii++) for (int jj = j; jj < j + 15; jj++, sq++) if (i != ii || j != jj) { ll now = (r[i][j] - r[ii][jj]) * (r[i][j] - r[ii][jj]) + (g[i][j] - g[ii][jj]) * (g[i][j] - g[ii][jj]) + (b[i][j] - b[ii][jj]) * (b[i][j] - b[ii][jj]); sum += now, cnt[now]++;}
for (int i = 0; i < 255 * 255 * 3 + 69420; i++) { tmp += cnt[i]; if (tmp > sq >> 1LL) { mid = i; break; } }
if (((sum / sq) / mid > 10LL) & ((sum / sq) > 2000LL)) return 1;
if (mid < 200LL) return 4;
if (mid < 3500LL) return 2;
return 3;
}
// dumb task
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |