# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
764013 | ymm | Art Class (IOI13_artclass) | C++17 | 58 ms | 3336 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>
#define Loop(x, l, r) for (ll x = (l); x < (r); ++x)
typedef long long ll;
typedef std::pair<int,int> pii;
typedef std::pair<ll ,ll > pll;
using namespace std;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
ll sumdif = 0;
ll cntbig = 0;
Loop (i,0,H) Loop (j,0,W) {
for (auto [x, y] : {pii{0, -1}, {0, 1}, {-1, 0}, {1, 0}}) {
int ii = i+x, jj = j+y;
if (ii < 0 || H <= ii || jj < 0 || W <= jj)
continue;
int dif = 0;
for (auto X : {R, G, B})
dif += abs(X[ii][jj] - X[i][j]);
if (dif >= 32)
cntbig++;
else
sumdif += dif;
}
}
double a = (double)sumdif/(H*W);
double b = (double)cntbig/(H*W);
if (b < 0.1)
return 4;
if (b < 1)
return 1;
if (b < 2)
return 2;
return 3;
cout << fixed << setprecision(9);
cout << a << ' ' << b << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |