#include <bits/stdc++.h>
#include "artclass.h"
typedef long long ll;
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
std::vector <ll> cnt(255 * 255 * 3 + 69420, 0);
ll sum = 0, sq = 0, tmp = 0, mid = 0;
for (int i = 15; i < h - 15; i++) for (int j = 15; j < w - 15; j++) for (int ii = i; ii < i + 15; ii++) for (int jj = j; jj < j + 15; jj++, sq++) if (i != ii || j != jj) { ll now = (r[i][j] - r[ii][jj]) * (r[i][j] - r[ii][jj]) + (g[i][j] - g[ii][jj]) * (g[i][j] - g[ii][jj]) + (b[i][j] - b[ii][jj]) * (b[i][j] - b[ii][jj]); sum += now, cnt[now]++;}
for (int i = 0; i < 255 * 255 * 3 + 69420; i++) { tmp += cnt[i]; if (tmp > sq >> 1LL) { mid = i; break; } }
if (((sum / sq) / mid > 10LL) & ((sum / sq) > 2000LL)) return 1;
if (mid < 200LL) return 4;
if (mid < 3500LL) return 2;
return 3;
}
// dumb task
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
408 ms |
7800 KB |
Output is correct |
2 |
Incorrect |
448 ms |
8056 KB |
Output isn't correct |
3 |
Correct |
406 ms |
8312 KB |
Output is correct |
4 |
Correct |
359 ms |
7416 KB |
Output is correct |
5 |
Correct |
253 ms |
7032 KB |
Output is correct |
6 |
Correct |
413 ms |
8056 KB |
Output is correct |
7 |
Correct |
347 ms |
7416 KB |
Output is correct |
8 |
Correct |
286 ms |
6008 KB |
Output is correct |
9 |
Incorrect |
338 ms |
7416 KB |
Output isn't correct |
10 |
Correct |
336 ms |
6648 KB |
Output is correct |
11 |
Correct |
428 ms |
8060 KB |
Output is correct |
12 |
Correct |
219 ms |
5240 KB |
Output is correct |
13 |
Correct |
339 ms |
6776 KB |
Output is correct |
14 |
Correct |
395 ms |
7800 KB |
Output is correct |
15 |
Correct |
262 ms |
6904 KB |
Output is correct |
16 |
Correct |
278 ms |
7032 KB |
Output is correct |
17 |
Correct |
422 ms |
8184 KB |
Output is correct |
18 |
Correct |
354 ms |
7544 KB |
Output is correct |
19 |
Correct |
276 ms |
5752 KB |
Output is correct |
20 |
Correct |
332 ms |
7288 KB |
Output is correct |
21 |
Correct |
388 ms |
7544 KB |
Output is correct |
22 |
Correct |
359 ms |
7416 KB |
Output is correct |
23 |
Correct |
321 ms |
6392 KB |
Output is correct |
24 |
Correct |
353 ms |
7544 KB |
Output is correct |
25 |
Correct |
297 ms |
7288 KB |
Output is correct |
26 |
Correct |
331 ms |
7288 KB |
Output is correct |
27 |
Correct |
322 ms |
7288 KB |
Output is correct |
28 |
Correct |
260 ms |
6748 KB |
Output is correct |
29 |
Correct |
331 ms |
7416 KB |
Output is correct |
30 |
Correct |
352 ms |
7160 KB |
Output is correct |
31 |
Correct |
321 ms |
6396 KB |
Output is correct |
32 |
Correct |
357 ms |
7416 KB |
Output is correct |
33 |
Correct |
369 ms |
7416 KB |
Output is correct |
34 |
Correct |
343 ms |
7032 KB |
Output is correct |
35 |
Correct |
277 ms |
7160 KB |
Output is correct |
36 |
Correct |
351 ms |
6776 KB |
Output is correct |
37 |
Correct |
255 ms |
6808 KB |
Output is correct |
38 |
Correct |
324 ms |
7288 KB |
Output is correct |
39 |
Correct |
327 ms |
6392 KB |
Output is correct |
40 |
Correct |
295 ms |
6136 KB |
Output is correct |
41 |
Correct |
358 ms |
7032 KB |
Output is correct |
42 |
Correct |
227 ms |
5496 KB |
Output is correct |
43 |
Correct |
343 ms |
7288 KB |
Output is correct |
44 |
Correct |
262 ms |
7288 KB |
Output is correct |
45 |
Correct |
335 ms |
7544 KB |
Output is correct |
46 |
Correct |
433 ms |
8056 KB |
Output is correct |
47 |
Correct |
76 ms |
3584 KB |
Output is correct |
48 |
Correct |
268 ms |
7160 KB |
Output is correct |
49 |
Correct |
221 ms |
6904 KB |
Output is correct |
50 |
Correct |
327 ms |
6520 KB |
Output is correct |
51 |
Correct |
334 ms |
6520 KB |
Output is correct |
52 |
Correct |
369 ms |
6648 KB |
Output is correct |
53 |
Correct |
384 ms |
7032 KB |
Output is correct |
54 |
Correct |
173 ms |
4600 KB |
Output is correct |
55 |
Correct |
446 ms |
7800 KB |
Output is correct |
56 |
Correct |
399 ms |
7032 KB |
Output is correct |
57 |
Correct |
83 ms |
5880 KB |
Output is correct |
58 |
Correct |
230 ms |
6904 KB |
Output is correct |
59 |
Correct |
338 ms |
7416 KB |
Output is correct |
60 |
Correct |
339 ms |
6776 KB |
Output is correct |
61 |
Correct |
180 ms |
6520 KB |
Output is correct |
62 |
Correct |
420 ms |
8184 KB |
Output is correct |
63 |
Correct |
338 ms |
6520 KB |
Output is correct |
64 |
Correct |
220 ms |
5112 KB |
Output is correct |
65 |
Correct |
183 ms |
4600 KB |
Output is correct |
66 |
Correct |
334 ms |
6392 KB |
Output is correct |
67 |
Correct |
221 ms |
5240 KB |
Output is correct |
68 |
Correct |
184 ms |
4728 KB |
Output is correct |
69 |
Correct |
414 ms |
8056 KB |
Output is correct |
70 |
Incorrect |
350 ms |
7416 KB |
Output isn't correct |
71 |
Correct |
206 ms |
5172 KB |
Output is correct |
72 |
Correct |
352 ms |
6776 KB |
Output is correct |
73 |
Correct |
358 ms |
7800 KB |
Output is correct |
74 |
Correct |
366 ms |
7288 KB |
Output is correct |
75 |
Correct |
360 ms |
7800 KB |
Output is correct |
76 |
Correct |
433 ms |
8056 KB |
Output is correct |
77 |
Correct |
348 ms |
6776 KB |
Output is correct |
78 |
Correct |
235 ms |
6776 KB |
Output is correct |
79 |
Correct |
424 ms |
7672 KB |
Output is correct |
80 |
Correct |
373 ms |
7544 KB |
Output is correct |
81 |
Correct |
352 ms |
7544 KB |
Output is correct |
82 |
Correct |
339 ms |
6904 KB |
Output is correct |
83 |
Correct |
317 ms |
6520 KB |
Output is correct |
84 |
Correct |
319 ms |
7160 KB |
Output is correct |
85 |
Correct |
339 ms |
6904 KB |
Output is correct |
86 |
Correct |
352 ms |
7544 KB |
Output is correct |
87 |
Correct |
376 ms |
7416 KB |
Output is correct |
88 |
Correct |
262 ms |
5880 KB |
Output is correct |
89 |
Correct |
327 ms |
6520 KB |
Output is correct |
90 |
Correct |
332 ms |
7416 KB |
Output is correct |
91 |
Correct |
331 ms |
6648 KB |
Output is correct |
92 |
Correct |
341 ms |
7288 KB |
Output is correct |
93 |
Correct |
389 ms |
7928 KB |
Output is correct |
94 |
Correct |
373 ms |
6796 KB |
Output is correct |
95 |
Correct |
396 ms |
7032 KB |
Output is correct |
96 |
Incorrect |
436 ms |
8184 KB |
Output isn't correct |
97 |
Correct |
254 ms |
7032 KB |
Output is correct |
98 |
Correct |
418 ms |
8184 KB |
Output is correct |
99 |
Correct |
331 ms |
6520 KB |
Output is correct |
100 |
Correct |
272 ms |
5884 KB |
Output is correct |
101 |
Correct |
346 ms |
7544 KB |
Output is correct |
102 |
Correct |
255 ms |
6904 KB |
Output is correct |