# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43826 | PowerOfNinjaGo | Art Class (IOI13_artclass) | C++14 | 150 ms | 3652 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.
//Power Of Ninja Go
#include <bits/stdc++.h>
#ifdef atom
#include "gradertxt.c"
#else
#include "artclass.h"
#endif
using namespace std;
typedef long long ll; typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vii vector< ii >
#define pb push_back
int sq(int x){ return x*x;}
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
double res = 0;
int n = H, m = W;
for(int i = 0; i< n; i++)
{
for(int j = 0; j< m; j++)
{
int tmp = 0;
double r = 0, g = 0, b = 0;
for(int p = 0; p< 4; p++)
{
int ni = i+dx[p], nj = j+dy[p];
if(ni< 0 || ni>= n || nj< 0 || nj>= m) continue;
r += R[ni][nj], g += G[ni][nj], b += B[ni][nj];
tmp++;
}
r /= tmp; g /= tmp; b/= tmp;
res += sq(r-R[i][j])+sq(g-G[i][j])+sq(b-B[i][j]);
}
}
double tot = 0;
for(int i = 0; i< n; i++)
{
for(int j = 0; j< m; j++)
{
tot += R[i][j] +G[i][j] + B[i][j];
}
}
res /= n*m;
tot /= n*m;
if(res> 1000) return 3;
else if(res< 26) return 4;
else if(tot>= 380) return 1;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |