# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
396450 | Kenzo_1114 | Art Class (IOI13_artclass) | C++17 | 85 ms | 3268 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<bits/stdc++.h>
#include"artclass.h"
using namespace std;
const int MAXN = 500;
const int MAXC = 260;
int cnt(int H, int W, int R[500][500], int G[500][500], int B[500][500], int val)
{
int T = 0;
for(int i = 0; i < H; i++)
for(int j = 0; j < W; j++)
{
int r = R[i][j];
int g = G[i][j];
int b = B[i][j];
if(j)
{
int r2 = R[i][j - 1];
int g2 = G[i][j - 1];
int b2 = B[i][j - 1];
if(abs(r - r2) + abs(g - g2) + abs(b - b2) <= val) continue;
}
if(i)
{
int r2 = R[i - 1][j];
int g2 = G[i - 1][j];
int b2 = B[i - 1][j];
if(abs(r - r2) + abs(g - g2) + abs(b - b2) <= val) continue;
}
++T;
}
return T;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
int white = 0;
for(int i = 0; i < H; i++)
for(int j = 0; j < W; j++)
{
int r = R[i][j];
int g = G[i][j];
int b = B[i][j];
if(r + g + b >= 720) white++;
}
if((double) 100 * cnt(H, W, R, G, B, 130) / (H * W) >= (double) 2) return 3;
if((double) 100 * white / (H * W) >= (double) 0.2) return 1;
if((double) 100 * cnt(H, W, R, G, B, 25) / (H * W) <= (double) 5) return 4;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |