#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) 0.80) return 4;
return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
3140 KB |
Output is correct |
2 |
Correct |
32 ms |
3168 KB |
Output is correct |
3 |
Correct |
53 ms |
2628 KB |
Output is correct |
4 |
Correct |
54 ms |
2728 KB |
Output is correct |
5 |
Correct |
34 ms |
1772 KB |
Output is correct |
6 |
Incorrect |
42 ms |
3140 KB |
Output isn't correct |
7 |
Correct |
45 ms |
3188 KB |
Output is correct |
8 |
Correct |
34 ms |
1772 KB |
Output is correct |
9 |
Correct |
54 ms |
2640 KB |
Output is correct |
10 |
Correct |
41 ms |
2040 KB |
Output is correct |
11 |
Correct |
27 ms |
1496 KB |
Output is correct |
12 |
Correct |
34 ms |
1708 KB |
Output is correct |
13 |
Correct |
41 ms |
2116 KB |
Output is correct |
14 |
Correct |
53 ms |
3156 KB |
Output is correct |
15 |
Correct |
56 ms |
2756 KB |
Output is correct |
16 |
Incorrect |
54 ms |
3096 KB |
Output isn't correct |
17 |
Correct |
61 ms |
2772 KB |
Output is correct |
18 |
Correct |
57 ms |
3184 KB |
Output is correct |
19 |
Correct |
47 ms |
3268 KB |
Output is correct |
20 |
Correct |
68 ms |
3140 KB |
Output is correct |
21 |
Correct |
50 ms |
2448 KB |
Output is correct |
22 |
Correct |
53 ms |
3140 KB |
Output is correct |
23 |
Correct |
64 ms |
3136 KB |
Output is correct |
24 |
Correct |
42 ms |
3144 KB |
Output is correct |
25 |
Correct |
27 ms |
1480 KB |
Output is correct |
26 |
Correct |
52 ms |
3192 KB |
Output is correct |
27 |
Correct |
61 ms |
2628 KB |
Output is correct |
28 |
Incorrect |
53 ms |
2728 KB |
Output isn't correct |
29 |
Correct |
64 ms |
3140 KB |
Output is correct |
30 |
Correct |
51 ms |
2560 KB |
Output is correct |
31 |
Correct |
63 ms |
2612 KB |
Output is correct |
32 |
Correct |
16 ms |
3216 KB |
Output is correct |
33 |
Correct |
71 ms |
3296 KB |
Output is correct |
34 |
Correct |
64 ms |
3196 KB |
Output is correct |
35 |
Correct |
54 ms |
3176 KB |
Output is correct |
36 |
Correct |
56 ms |
3140 KB |
Output is correct |
37 |
Incorrect |
66 ms |
3192 KB |
Output isn't correct |
38 |
Correct |
58 ms |
2804 KB |
Output is correct |
39 |
Correct |
44 ms |
3140 KB |
Output is correct |
40 |
Correct |
55 ms |
2628 KB |
Output is correct |
41 |
Correct |
70 ms |
3188 KB |
Output is correct |
42 |
Incorrect |
51 ms |
2408 KB |
Output isn't correct |
43 |
Correct |
67 ms |
3140 KB |
Output is correct |
44 |
Correct |
44 ms |
2172 KB |
Output is correct |
45 |
Correct |
50 ms |
2436 KB |
Output is correct |
46 |
Incorrect |
63 ms |
3192 KB |
Output isn't correct |
47 |
Incorrect |
48 ms |
2432 KB |
Output isn't correct |
48 |
Correct |
36 ms |
3140 KB |
Output is correct |
49 |
Incorrect |
44 ms |
3244 KB |
Output isn't correct |
50 |
Correct |
67 ms |
3208 KB |
Output is correct |
51 |
Correct |
55 ms |
3180 KB |
Output is correct |
52 |
Correct |
63 ms |
3096 KB |
Output is correct |
53 |
Incorrect |
55 ms |
3160 KB |
Output isn't correct |
54 |
Correct |
40 ms |
2028 KB |
Output is correct |
55 |
Correct |
53 ms |
3212 KB |
Output is correct |
56 |
Correct |
46 ms |
3168 KB |
Output is correct |
57 |
Correct |
48 ms |
2412 KB |
Output is correct |
58 |
Incorrect |
52 ms |
3140 KB |
Output isn't correct |
59 |
Correct |
55 ms |
3140 KB |
Output is correct |
60 |
Incorrect |
47 ms |
3168 KB |
Output isn't correct |
61 |
Correct |
52 ms |
3116 KB |
Output is correct |
62 |
Correct |
59 ms |
2968 KB |
Output is correct |
63 |
Correct |
81 ms |
3140 KB |
Output is correct |
64 |
Correct |
63 ms |
3148 KB |
Output is correct |
65 |
Correct |
56 ms |
3092 KB |
Output is correct |
66 |
Correct |
52 ms |
3112 KB |
Output is correct |
67 |
Correct |
29 ms |
1604 KB |
Output is correct |
68 |
Correct |
64 ms |
3152 KB |
Output is correct |
69 |
Correct |
54 ms |
2616 KB |
Output is correct |
70 |
Correct |
39 ms |
3128 KB |
Output is correct |
71 |
Correct |
54 ms |
3156 KB |
Output is correct |
72 |
Correct |
52 ms |
2568 KB |
Output is correct |
73 |
Incorrect |
49 ms |
2500 KB |
Output isn't correct |
74 |
Correct |
49 ms |
2396 KB |
Output is correct |
75 |
Correct |
50 ms |
3132 KB |
Output is correct |
76 |
Incorrect |
58 ms |
2884 KB |
Output isn't correct |
77 |
Incorrect |
59 ms |
3144 KB |
Output isn't correct |
78 |
Incorrect |
55 ms |
2736 KB |
Output isn't correct |
79 |
Incorrect |
65 ms |
3164 KB |
Output isn't correct |
80 |
Correct |
43 ms |
2116 KB |
Output is correct |
81 |
Correct |
39 ms |
3160 KB |
Output is correct |
82 |
Correct |
78 ms |
3148 KB |
Output is correct |
83 |
Correct |
54 ms |
3124 KB |
Output is correct |
84 |
Correct |
54 ms |
3188 KB |
Output is correct |
85 |
Incorrect |
69 ms |
3200 KB |
Output isn't correct |
86 |
Correct |
73 ms |
2668 KB |
Output is correct |
87 |
Correct |
49 ms |
2560 KB |
Output is correct |
88 |
Correct |
13 ms |
844 KB |
Output is correct |
89 |
Correct |
52 ms |
3144 KB |
Output is correct |
90 |
Correct |
52 ms |
2548 KB |
Output is correct |
91 |
Correct |
43 ms |
3200 KB |
Output is correct |
92 |
Correct |
40 ms |
3204 KB |
Output is correct |
93 |
Correct |
48 ms |
2372 KB |
Output is correct |
94 |
Correct |
37 ms |
1868 KB |
Output is correct |
95 |
Incorrect |
62 ms |
3116 KB |
Output isn't correct |
96 |
Correct |
63 ms |
3116 KB |
Output is correct |
97 |
Incorrect |
35 ms |
1860 KB |
Output isn't correct |
98 |
Correct |
53 ms |
2568 KB |
Output is correct |
99 |
Incorrect |
76 ms |
2880 KB |
Output isn't correct |
100 |
Incorrect |
64 ms |
3244 KB |
Output isn't correct |
101 |
Correct |
64 ms |
3208 KB |
Output is correct |
102 |
Correct |
51 ms |
3196 KB |
Output is correct |