# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
367194 | idk321 | Art Class (IOI13_artclass) | C++11 | 166 ms | 13548 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 "artclass.h"
#include <bits/stdc++.h>
using namespace std;
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
vector<int> differences;
map<array<int, 3>, int> freq;
for (int i = 0; i < h; i++)
{
for (int j = 0; j < w; j++)
{
/*
for (int k = -1; k <= 1; k++)
{
for (int l = -1; l <= 1; l++)
{
int i2 = i + k;
int j2 = j + l;
if (i2 == i && j2 == j) continue;
if (i2 >= 0 && i2 < h && j2 >= 0 && j2 < w)
{
int diff = abs(r[i2][j2] - r[i][j]);
diff += abs(g[i2][j2] - g[i][j]);
diff += abs(b[i2][j2] - b[i][j]);
diff *= diff;
differences.push_back(diff);
}
}
} */
freq[{r[i][j], g[i][j], b[i][j]}]++;
}
}
int diff = 0;
double sum = 0;
for (auto it = freq.begin(); it != freq.end(); it++)
{
sum += it->second * it->second;
diff++;
}
if (sum / diff > 1000)
{
return 1;
} else return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |