#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 |
1 |
Correct |
63 ms |
3108 KB |
Output is correct |
2 |
Correct |
49 ms |
2424 KB |
Output is correct |
3 |
Correct |
35 ms |
1736 KB |
Output is correct |
4 |
Correct |
85 ms |
3152 KB |
Output is correct |
5 |
Incorrect |
55 ms |
2720 KB |
Output isn't correct |
6 |
Correct |
56 ms |
3172 KB |
Output is correct |
7 |
Incorrect |
56 ms |
3104 KB |
Output isn't correct |
8 |
Correct |
65 ms |
3144 KB |
Output is correct |
9 |
Correct |
16 ms |
3132 KB |
Output is correct |
10 |
Incorrect |
48 ms |
2416 KB |
Output isn't correct |
11 |
Correct |
42 ms |
3152 KB |
Output is correct |
12 |
Correct |
45 ms |
3220 KB |
Output is correct |
13 |
Correct |
54 ms |
3164 KB |
Output is correct |
14 |
Correct |
58 ms |
2848 KB |
Output is correct |
15 |
Correct |
53 ms |
2396 KB |
Output is correct |
16 |
Correct |
32 ms |
3180 KB |
Output is correct |
17 |
Correct |
39 ms |
3156 KB |
Output is correct |
18 |
Correct |
59 ms |
2628 KB |
Output is correct |
19 |
Correct |
44 ms |
3116 KB |
Output is correct |
20 |
Correct |
54 ms |
3220 KB |
Output is correct |
21 |
Correct |
85 ms |
3148 KB |
Output is correct |
22 |
Correct |
54 ms |
3140 KB |
Output is correct |
23 |
Correct |
55 ms |
2628 KB |
Output is correct |
24 |
Correct |
54 ms |
2596 KB |
Output is correct |
25 |
Correct |
47 ms |
3152 KB |
Output is correct |
26 |
Incorrect |
61 ms |
3124 KB |
Output isn't correct |
27 |
Correct |
62 ms |
2440 KB |
Output is correct |
28 |
Correct |
41 ms |
3120 KB |
Output is correct |
29 |
Correct |
56 ms |
2724 KB |
Output is correct |
30 |
Correct |
52 ms |
3164 KB |
Output is correct |
31 |
Correct |
66 ms |
3164 KB |
Output is correct |
32 |
Correct |
27 ms |
1372 KB |
Output is correct |
33 |
Correct |
55 ms |
3104 KB |
Output is correct |
34 |
Correct |
53 ms |
3140 KB |
Output is correct |
35 |
Correct |
52 ms |
3108 KB |
Output is correct |
36 |
Correct |
14 ms |
844 KB |
Output is correct |
37 |
Incorrect |
65 ms |
3144 KB |
Output isn't correct |
38 |
Correct |
70 ms |
3140 KB |
Output is correct |
39 |
Correct |
54 ms |
2560 KB |
Output is correct |
40 |
Correct |
35 ms |
1772 KB |
Output is correct |
41 |
Correct |
50 ms |
2448 KB |
Output is correct |
42 |
Correct |
60 ms |
3012 KB |
Output is correct |
43 |
Correct |
39 ms |
3128 KB |
Output is correct |
44 |
Correct |
51 ms |
3140 KB |
Output is correct |
45 |
Incorrect |
64 ms |
2748 KB |
Output isn't correct |
46 |
Correct |
55 ms |
3244 KB |
Output is correct |
47 |
Correct |
67 ms |
3096 KB |
Output is correct |
48 |
Correct |
57 ms |
3140 KB |
Output is correct |
49 |
Correct |
74 ms |
3140 KB |
Output is correct |
50 |
Correct |
41 ms |
3140 KB |
Output is correct |
51 |
Correct |
57 ms |
2756 KB |
Output is correct |
52 |
Correct |
42 ms |
2156 KB |
Output is correct |
53 |
Correct |
58 ms |
3208 KB |
Output is correct |
54 |
Incorrect |
58 ms |
2752 KB |
Output isn't correct |
55 |
Correct |
34 ms |
1704 KB |
Output is correct |
56 |
Correct |
42 ms |
3208 KB |
Output is correct |
57 |
Correct |
53 ms |
3172 KB |
Output is correct |
58 |
Correct |
27 ms |
1484 KB |
Output is correct |
59 |
Incorrect |
70 ms |
3112 KB |
Output isn't correct |
60 |
Correct |
53 ms |
2632 KB |
Output is correct |
61 |
Correct |
63 ms |
3152 KB |
Output is correct |
62 |
Incorrect |
55 ms |
3140 KB |
Output isn't correct |
63 |
Correct |
67 ms |
3140 KB |
Output is correct |
64 |
Correct |
44 ms |
2124 KB |
Output is correct |
65 |
Incorrect |
38 ms |
1860 KB |
Output isn't correct |
66 |
Incorrect |
53 ms |
3120 KB |
Output isn't correct |
67 |
Correct |
57 ms |
2636 KB |
Output is correct |
68 |
Correct |
48 ms |
2428 KB |
Output is correct |
69 |
Correct |
35 ms |
1792 KB |
Output is correct |
70 |
Correct |
66 ms |
3108 KB |
Output is correct |
71 |
Correct |
53 ms |
2632 KB |
Output is correct |
72 |
Correct |
54 ms |
3140 KB |
Output is correct |
73 |
Correct |
50 ms |
2500 KB |
Output is correct |
74 |
Correct |
51 ms |
3156 KB |
Output is correct |
75 |
Correct |
55 ms |
2628 KB |
Output is correct |
76 |
Correct |
53 ms |
2520 KB |
Output is correct |
77 |
Correct |
61 ms |
3180 KB |
Output is correct |
78 |
Correct |
47 ms |
2372 KB |
Output is correct |
79 |
Correct |
52 ms |
2628 KB |
Output is correct |
80 |
Correct |
35 ms |
3140 KB |
Output is correct |
81 |
Correct |
63 ms |
3160 KB |
Output is correct |
82 |
Correct |
63 ms |
3204 KB |
Output is correct |
83 |
Correct |
41 ms |
3172 KB |
Output is correct |
84 |
Correct |
59 ms |
2500 KB |
Output is correct |
85 |
Incorrect |
50 ms |
2556 KB |
Output isn't correct |
86 |
Correct |
52 ms |
1992 KB |
Output is correct |
87 |
Correct |
59 ms |
3132 KB |
Output is correct |
88 |
Correct |
29 ms |
1484 KB |
Output is correct |
89 |
Correct |
63 ms |
3140 KB |
Output is correct |
90 |
Correct |
41 ms |
2044 KB |
Output is correct |
91 |
Correct |
56 ms |
2752 KB |
Output is correct |
92 |
Correct |
59 ms |
3160 KB |
Output is correct |
93 |
Correct |
46 ms |
3164 KB |
Output is correct |
94 |
Incorrect |
49 ms |
2488 KB |
Output isn't correct |
95 |
Correct |
53 ms |
3140 KB |
Output is correct |
96 |
Correct |
52 ms |
3140 KB |
Output is correct |
97 |
Incorrect |
66 ms |
3108 KB |
Output isn't correct |
98 |
Correct |
63 ms |
3144 KB |
Output is correct |
99 |
Correct |
45 ms |
3208 KB |
Output is correct |
100 |
Correct |
55 ms |
3140 KB |
Output is correct |
101 |
Incorrect |
48 ms |
3268 KB |
Output isn't correct |
102 |
Correct |
54 ms |
2048 KB |
Output is correct |