#include <bits/stdc++.h>
#include "artclass.h"
int ri() {
int n;
scanf("%d", &n);
return n;
}
int solve(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
const int THRESHOLD = 50;
int r0 = 0;
int r1 = 0;
for (int i = 0; i + 1 < h; i++) {
for (int j = 0; j < w; j++) {
int cur_diff = std::abs(r[i][j] - r[i + 1][j]) + std::abs(g[i][j] - g[i + 1][j]) + std::abs(b[i][j] - b[i + 1][j]);
if (cur_diff < THRESHOLD) r0 += cur_diff;
else r1 += cur_diff;
}
}
r0 = r0 * 10 / h / w;
r1 = r1 * 10 / h / w;
if (r1 <= 15) return 4;
else if (r1 >= 400) return 3;
if (r0 <= 125) return 1;
else return 2;
}
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
return solve(h, w, r, g, b);
}
Compilation message
artclass.cpp: In function 'int ri()':
artclass.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
6 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
66 ms |
2756 KB |
Output isn't correct |
2 |
Correct |
53 ms |
2616 KB |
Output is correct |
3 |
Correct |
58 ms |
2604 KB |
Output is correct |
4 |
Correct |
65 ms |
2724 KB |
Output is correct |
5 |
Incorrect |
58 ms |
3140 KB |
Output isn't correct |
6 |
Correct |
60 ms |
3176 KB |
Output is correct |
7 |
Correct |
59 ms |
3180 KB |
Output is correct |
8 |
Correct |
72 ms |
3212 KB |
Output is correct |
9 |
Correct |
63 ms |
3196 KB |
Output is correct |
10 |
Correct |
40 ms |
3136 KB |
Output is correct |
11 |
Correct |
73 ms |
2732 KB |
Output is correct |
12 |
Correct |
55 ms |
3204 KB |
Output is correct |
13 |
Correct |
66 ms |
2588 KB |
Output is correct |
14 |
Correct |
57 ms |
2792 KB |
Output is correct |
15 |
Correct |
68 ms |
3232 KB |
Output is correct |
16 |
Correct |
33 ms |
3212 KB |
Output is correct |
17 |
Correct |
55 ms |
3140 KB |
Output is correct |
18 |
Incorrect |
76 ms |
3168 KB |
Output isn't correct |
19 |
Correct |
40 ms |
2168 KB |
Output is correct |
20 |
Correct |
62 ms |
3172 KB |
Output is correct |
21 |
Correct |
65 ms |
3168 KB |
Output is correct |
22 |
Correct |
40 ms |
2052 KB |
Output is correct |
23 |
Correct |
52 ms |
3216 KB |
Output is correct |
24 |
Incorrect |
49 ms |
2372 KB |
Output isn't correct |
25 |
Correct |
63 ms |
3196 KB |
Output is correct |
26 |
Correct |
42 ms |
3160 KB |
Output is correct |
27 |
Correct |
67 ms |
3128 KB |
Output is correct |
28 |
Correct |
69 ms |
3028 KB |
Output is correct |
29 |
Correct |
34 ms |
1660 KB |
Output is correct |
30 |
Correct |
53 ms |
2532 KB |
Output is correct |
31 |
Correct |
41 ms |
3104 KB |
Output is correct |
32 |
Correct |
27 ms |
1356 KB |
Output is correct |
33 |
Incorrect |
53 ms |
2696 KB |
Output isn't correct |
34 |
Correct |
38 ms |
3204 KB |
Output is correct |
35 |
Correct |
43 ms |
2176 KB |
Output is correct |
36 |
Correct |
59 ms |
3196 KB |
Output is correct |
37 |
Correct |
58 ms |
2016 KB |
Output is correct |
38 |
Correct |
70 ms |
3180 KB |
Output is correct |
39 |
Correct |
58 ms |
2572 KB |
Output is correct |
40 |
Correct |
55 ms |
3144 KB |
Output is correct |
41 |
Correct |
17 ms |
812 KB |
Output is correct |
42 |
Correct |
52 ms |
2708 KB |
Output is correct |
43 |
Correct |
62 ms |
2656 KB |
Output is correct |
44 |
Correct |
66 ms |
3200 KB |
Output is correct |
45 |
Incorrect |
41 ms |
3104 KB |
Output isn't correct |
46 |
Correct |
52 ms |
3140 KB |
Output is correct |
47 |
Incorrect |
74 ms |
3224 KB |
Output isn't correct |
48 |
Correct |
53 ms |
3104 KB |
Output is correct |
49 |
Correct |
46 ms |
3148 KB |
Output is correct |
50 |
Correct |
75 ms |
2756 KB |
Output is correct |
51 |
Correct |
45 ms |
3140 KB |
Output is correct |
52 |
Correct |
51 ms |
2508 KB |
Output is correct |
53 |
Correct |
64 ms |
3132 KB |
Output is correct |
54 |
Correct |
64 ms |
2492 KB |
Output is correct |
55 |
Correct |
52 ms |
2632 KB |
Output is correct |
56 |
Correct |
36 ms |
3204 KB |
Output is correct |
57 |
Correct |
43 ms |
2172 KB |
Output is correct |
58 |
Correct |
47 ms |
2372 KB |
Output is correct |
59 |
Correct |
46 ms |
3152 KB |
Output is correct |
60 |
Correct |
44 ms |
3148 KB |
Output is correct |
61 |
Correct |
39 ms |
3168 KB |
Output is correct |
62 |
Correct |
51 ms |
3160 KB |
Output is correct |
63 |
Correct |
46 ms |
3168 KB |
Output is correct |
64 |
Correct |
51 ms |
2620 KB |
Output is correct |
65 |
Correct |
62 ms |
3200 KB |
Output is correct |
66 |
Correct |
48 ms |
2360 KB |
Output is correct |
67 |
Correct |
48 ms |
2572 KB |
Output is correct |
68 |
Correct |
59 ms |
3196 KB |
Output is correct |
69 |
Correct |
48 ms |
2564 KB |
Output is correct |
70 |
Correct |
76 ms |
3140 KB |
Output is correct |
71 |
Correct |
54 ms |
3156 KB |
Output is correct |
72 |
Correct |
58 ms |
3192 KB |
Output is correct |
73 |
Correct |
53 ms |
2628 KB |
Output is correct |
74 |
Correct |
39 ms |
3088 KB |
Output is correct |
75 |
Correct |
16 ms |
3148 KB |
Output is correct |
76 |
Correct |
69 ms |
3148 KB |
Output is correct |
77 |
Correct |
88 ms |
3204 KB |
Output is correct |
78 |
Correct |
52 ms |
3092 KB |
Output is correct |
79 |
Correct |
63 ms |
3144 KB |
Output is correct |
80 |
Correct |
47 ms |
2416 KB |
Output is correct |
81 |
Incorrect |
57 ms |
3088 KB |
Output isn't correct |
82 |
Correct |
34 ms |
1716 KB |
Output is correct |
83 |
Correct |
52 ms |
3140 KB |
Output is correct |
84 |
Correct |
36 ms |
1860 KB |
Output is correct |
85 |
Correct |
49 ms |
3140 KB |
Output is correct |
86 |
Correct |
41 ms |
3084 KB |
Output is correct |
87 |
Correct |
53 ms |
3136 KB |
Output is correct |
88 |
Correct |
47 ms |
2416 KB |
Output is correct |
89 |
Correct |
43 ms |
3200 KB |
Output is correct |
90 |
Correct |
45 ms |
1732 KB |
Output is correct |
91 |
Correct |
57 ms |
3140 KB |
Output is correct |
92 |
Correct |
58 ms |
2732 KB |
Output is correct |
93 |
Correct |
37 ms |
1724 KB |
Output is correct |
94 |
Correct |
64 ms |
3060 KB |
Output is correct |
95 |
Correct |
40 ms |
1500 KB |
Output is correct |
96 |
Correct |
67 ms |
3136 KB |
Output is correct |
97 |
Correct |
52 ms |
3188 KB |
Output is correct |
98 |
Correct |
27 ms |
1456 KB |
Output is correct |
99 |
Correct |
74 ms |
2760 KB |
Output is correct |
100 |
Correct |
63 ms |
3160 KB |
Output is correct |
101 |
Incorrect |
68 ms |
2532 KB |
Output isn't correct |
102 |
Correct |
63 ms |
3148 KB |
Output is correct |