#include "artclass.h"
#include <iostream>
using namespace std;
int t, n, m;
inline bool iswhite(int red, int green, int blue) {
return red > 140 && blue > 140 && green > 140 && abs(red - green) < 40 && abs(red - blue) < 40 && abs(blue - green) < 40;
}
inline bool isgreen(int red, int green, int blue) {
return green > 32 && green > blue+40 && green > red-8 && !iswhite(red, green, blue);
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int numzeros=0, grncnt=0, whitecnt=0, prevr=0, prevg=0, prevb=0;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
whitecnt += iswhite(R[i][j], G[i][j], B[i][j]);
grncnt += isgreen(R[i][j], G[i][j], B[i][j]);
if (abs(prevr - R[i][j]) + abs(prevg - G[i][j]) + abs(prevb - B[i][j]) < 8) numzeros++;
prevr = R[i][j];
prevg = G[i][j];
prevb = B[i][j];
}
}
if (numzeros < W*H*0.7) {
if (grncnt > n*m/10) return 2;
return 3;
} else {
if (whitecnt > n*m/4) return 1;
return 4;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
30 ms |
4576 KB |
Output isn't correct |
2 |
Incorrect |
52 ms |
6140 KB |
Output isn't correct |
3 |
Incorrect |
56 ms |
5932 KB |
Output isn't correct |
4 |
Correct |
38 ms |
4348 KB |
Output is correct |
5 |
Incorrect |
42 ms |
5088 KB |
Output isn't correct |
6 |
Correct |
42 ms |
4268 KB |
Output is correct |
7 |
Correct |
37 ms |
4812 KB |
Output is correct |
8 |
Correct |
50 ms |
5708 KB |
Output is correct |
9 |
Correct |
43 ms |
4616 KB |
Output is correct |
10 |
Correct |
41 ms |
5108 KB |
Output is correct |
11 |
Incorrect |
32 ms |
4632 KB |
Output isn't correct |
12 |
Correct |
63 ms |
5212 KB |
Output is correct |
13 |
Incorrect |
40 ms |
4688 KB |
Output isn't correct |
14 |
Incorrect |
41 ms |
4668 KB |
Output isn't correct |
15 |
Correct |
41 ms |
5168 KB |
Output is correct |
16 |
Incorrect |
52 ms |
6060 KB |
Output isn't correct |
17 |
Correct |
40 ms |
4684 KB |
Output is correct |
18 |
Incorrect |
46 ms |
4352 KB |
Output isn't correct |
19 |
Incorrect |
49 ms |
4932 KB |
Output isn't correct |
20 |
Correct |
42 ms |
4428 KB |
Output is correct |
21 |
Correct |
39 ms |
4196 KB |
Output is correct |
22 |
Incorrect |
49 ms |
5864 KB |
Output isn't correct |
23 |
Incorrect |
41 ms |
5296 KB |
Output isn't correct |
24 |
Correct |
34 ms |
3752 KB |
Output is correct |
25 |
Incorrect |
41 ms |
4800 KB |
Output isn't correct |
26 |
Incorrect |
47 ms |
4272 KB |
Output isn't correct |
27 |
Correct |
44 ms |
4320 KB |
Output is correct |
28 |
Correct |
41 ms |
4232 KB |
Output is correct |
29 |
Incorrect |
27 ms |
3016 KB |
Output isn't correct |
30 |
Correct |
58 ms |
5836 KB |
Output is correct |
31 |
Correct |
12 ms |
3652 KB |
Output is correct |
32 |
Incorrect |
58 ms |
5664 KB |
Output isn't correct |
33 |
Incorrect |
42 ms |
5280 KB |
Output isn't correct |
34 |
Incorrect |
34 ms |
3524 KB |
Output isn't correct |
35 |
Incorrect |
35 ms |
3720 KB |
Output isn't correct |
36 |
Incorrect |
51 ms |
5448 KB |
Output isn't correct |
37 |
Incorrect |
44 ms |
5688 KB |
Output isn't correct |
38 |
Incorrect |
51 ms |
5964 KB |
Output isn't correct |
39 |
Correct |
30 ms |
3276 KB |
Output is correct |
40 |
Incorrect |
32 ms |
3040 KB |
Output isn't correct |
41 |
Incorrect |
46 ms |
5220 KB |
Output isn't correct |
42 |
Correct |
44 ms |
4988 KB |
Output is correct |
43 |
Correct |
41 ms |
4860 KB |
Output is correct |
44 |
Incorrect |
71 ms |
5968 KB |
Output isn't correct |
45 |
Incorrect |
47 ms |
5360 KB |
Output isn't correct |
46 |
Incorrect |
58 ms |
5708 KB |
Output isn't correct |
47 |
Incorrect |
50 ms |
5836 KB |
Output isn't correct |
48 |
Incorrect |
27 ms |
4648 KB |
Output isn't correct |
49 |
Correct |
40 ms |
4408 KB |
Output is correct |
50 |
Incorrect |
47 ms |
5352 KB |
Output isn't correct |
51 |
Incorrect |
44 ms |
5328 KB |
Output isn't correct |
52 |
Incorrect |
44 ms |
5248 KB |
Output isn't correct |
53 |
Incorrect |
45 ms |
4552 KB |
Output isn't correct |
54 |
Correct |
39 ms |
5148 KB |
Output is correct |
55 |
Incorrect |
41 ms |
5440 KB |
Output isn't correct |
56 |
Correct |
44 ms |
5292 KB |
Output is correct |
57 |
Correct |
54 ms |
5048 KB |
Output is correct |
58 |
Correct |
53 ms |
4692 KB |
Output is correct |
59 |
Incorrect |
11 ms |
1444 KB |
Output isn't correct |
60 |
Correct |
48 ms |
5196 KB |
Output is correct |
61 |
Correct |
52 ms |
5884 KB |
Output is correct |
62 |
Incorrect |
23 ms |
2412 KB |
Output isn't correct |
63 |
Correct |
39 ms |
5020 KB |
Output is correct |
64 |
Correct |
55 ms |
4840 KB |
Output is correct |
65 |
Correct |
41 ms |
5048 KB |
Output is correct |
66 |
Incorrect |
44 ms |
5328 KB |
Output isn't correct |
67 |
Correct |
42 ms |
4940 KB |
Output is correct |
68 |
Correct |
39 ms |
4352 KB |
Output is correct |
69 |
Incorrect |
34 ms |
5068 KB |
Output isn't correct |
70 |
Correct |
47 ms |
5332 KB |
Output is correct |
71 |
Correct |
51 ms |
4468 KB |
Output is correct |
72 |
Incorrect |
23 ms |
2532 KB |
Output isn't correct |
73 |
Correct |
41 ms |
4984 KB |
Output is correct |
74 |
Incorrect |
32 ms |
4720 KB |
Output isn't correct |
75 |
Correct |
40 ms |
4348 KB |
Output is correct |
76 |
Incorrect |
46 ms |
5280 KB |
Output isn't correct |
77 |
Correct |
24 ms |
4300 KB |
Output is correct |
78 |
Correct |
53 ms |
5780 KB |
Output is correct |
79 |
Incorrect |
61 ms |
5792 KB |
Output isn't correct |
80 |
Correct |
60 ms |
4552 KB |
Output is correct |
81 |
Incorrect |
37 ms |
5084 KB |
Output isn't correct |
82 |
Incorrect |
34 ms |
2452 KB |
Output isn't correct |
83 |
Incorrect |
44 ms |
5300 KB |
Output isn't correct |
84 |
Correct |
45 ms |
5484 KB |
Output is correct |
85 |
Incorrect |
58 ms |
5804 KB |
Output isn't correct |
86 |
Correct |
45 ms |
5268 KB |
Output is correct |
87 |
Incorrect |
51 ms |
5380 KB |
Output isn't correct |
88 |
Incorrect |
44 ms |
5288 KB |
Output isn't correct |
89 |
Incorrect |
32 ms |
4736 KB |
Output isn't correct |
90 |
Incorrect |
28 ms |
3080 KB |
Output isn't correct |
91 |
Incorrect |
42 ms |
5148 KB |
Output isn't correct |
92 |
Correct |
28 ms |
3092 KB |
Output is correct |
93 |
Incorrect |
34 ms |
4044 KB |
Output isn't correct |
94 |
Incorrect |
33 ms |
4852 KB |
Output isn't correct |
95 |
Incorrect |
30 ms |
4556 KB |
Output isn't correct |
96 |
Correct |
47 ms |
4628 KB |
Output is correct |
97 |
Incorrect |
50 ms |
5336 KB |
Output isn't correct |
98 |
Correct |
38 ms |
4936 KB |
Output is correct |
99 |
Incorrect |
32 ms |
4812 KB |
Output isn't correct |
100 |
Incorrect |
32 ms |
3708 KB |
Output isn't correct |
101 |
Correct |
45 ms |
4380 KB |
Output is correct |
102 |
Incorrect |
46 ms |
5672 KB |
Output isn't correct |