# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1022102 | amine_aroua | Art Class (IOI13_artclass) | C++17 | 65 ms | 3412 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;
const int BASE = 256;
const int eps = 50;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int cnt = 0;
int mn[3] = {R[0][0] , G[0][0] , B[0][0]};
int mx[3] = {R[0][0] , G[0][0] , B[0][0]};
for(int i = 0 ; i < H ; i++)
{
for(int j = 0 ; j < W ; j++)
{
mn[0] = min(mn[0] , R[i][j]);
mx[0] = max(mx[0] ,R[i][j]);
mn[1] = min(mn[1] , G[i][j]);
mx[1] = max(mx[1] ,G[i][j]);
mn[2] = min(mn[2] , B[i][j]);
mx[2] = max(mx[2] ,B[i][j]);
for(int k = 0 ; k < 3 ; k++)
{
if(mx[k] - mn[k] > eps)
{
cnt++;
mn[0] = mx[0] = R[i][j];
mn[1] = mx[1] = G[i][j];
mn[2] = mx[2] = B[i][j];
break;
}
}
}
}
if(cnt <= 4000)
return 4;
else if(cnt <= 9000)
return 1;
else if(cnt <= 38000)
return 2;
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |