# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
289174 | egekabas | Art Class (IOI13_artclass) | C++14 | 124 ms | 6136 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 all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<int, int> pii;
typedef pair<ld, ld> pld;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
srand(time(NULL));
int dif = 0;
int green = 0;
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j){
if(i > 0){
dif += abs(R[i-1][j]-R[i][j]);
dif += abs(G[i-1][j]-G[i][j]);
dif += abs(B[i-1][j]-B[i][j]);
}
if(j > 0){
dif += abs(R[i][j]-R[i][j-1]);
dif += abs(G[i][j]-G[i][j-1]);
dif += abs(B[i][j]-B[i][j-1]);
}
green += G[i][j];
}
ld val = (dif/ld(H*W*255));
if(val > 0.4){
return 3;
}
if(val > 0.2)
return 2;
if(val > 0.1)
return 4;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |