# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940628 | Der_Vlapos | Art Class (IOI13_artclass) | C++17 | 58 ms | 4036 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;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
srand(time(NULL));
int cnt = 0;
int cnt2 = 0;
set <pair <int,pair <int,int> > > s;
for(int i = 0;i < H;i++) {
for(int j = 0;j < W;j++) {
if(G[i][j] > 150&&R[i][j] < 50&&B[i][j] < 50) {
cnt++;
}
if((G[i][j] > 200) + (R[i][j] > 200) + (B[i][j] > 200) > 2) cnt2++;
s.insert({R[i][j]/10,{G[i][j]/10,B[i][j]/10}});
}
}
int cnte = 0;
int cnt3 = 0,cnt5 = 0;
for(int i = 0;i < H;i++) {
for(int j = 0;j < W - 1;j++) {
int f1 = abs(G[i][j] - G[i][j + 1]) + abs(R[i][j] - R[i][j + 1]) + abs(B[i][j] - B[i][j + 1]);
if(f1 > 40) cnt3++;
if(f1 > 120) cnte++;
}
}
for(int i = 0;i < H - 1;i++) {
for(int j = 0;j < W;j++) {
int f1 = abs(G[i][j] - G[i + 1][j]) + abs(R[i + 1][j] - R[i][j]) + abs(B[i + 1][j] - B[i][j]);
if(f1 > 40) cnt5++;
if(f1 > 120) cnte++;
}
}
if(cnte > W*H/3) return 3;
if(cnt3 < H*W/60) return 0;
if(cnt2 > H*W/7) return 1;
int cnt4 = 0;
for(int i = 0;i < H;i++) {
for(int j = 0;j < W;j++) {
if(G[i][j] + R[i][j] + B[i][j] > 600) cnt4++;
}
}
if(cnt3 + cnt5 < W*H/10) {
if((cnt5 > cnt3 )) return 1;
return 0;
}
return 2;
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |