# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43824 | PowerOfNinjaGo | Art Class (IOI13_artclass) | C++14 | 124 ms | 3692 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 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;
int cnt = 0;
for(int i = 0; i< n; i++)
{
for(int j = 0; j< m; j++)
{
if(i+1< n) res += sq(R[i][j]-R[i+1][j])+sq(G[i][j]-G[i+1][j])+sq(B[i][j]-B[i+1][j]), cnt++;
if(j+1< m) res += sq(R[i][j]-R[i][j+1])+sq(G[i][j]-G[i][j+1])+sq(B[i][j]-B[i][j+1]), cnt++;
}
}
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];
}
}
tot /= n*m;
res /= cnt;
if(res> 2000) return 3;
else if(res< 150) return 4;
else if(tot> 380) return 1;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |