#include "artclass.h"
#include <bits/stdc++.h>
using namespace std;
int style(int h, int w, int R[500][500], int G[500][500], int B[500][500]) {
long long dif=0,gr=0,dif2=0;
const int dx[4]={1,1,1,0},dy[4]={1,0,-1,1};
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
for(int k=0;k<4;k++){
int a=i+dx[k],b=j+dy[k];
if(a>=h || b>=w || a<0 || b<0){
continue;
}
int dz=(R[i][j]-R[a][b])*(R[i][j]-R[a][b])+(G[i][j]-G[a][b])*(G[i][j]-G[a][b])+(B[i][j]-B[a][b])*(B[i][j]-B[a][b]);
dif+=dz;
dif2+=(k%2==0?dz:10*dz);
}
int z=max(0,G[i][j]-max(R[i][j],B[i][j]));
gr+=z*z;
}
}
//cout << dif << ' ' << gr << ' ' << dif2 << "\n";
if(dif<100000000){
return 4;
}
else if(dif>2000000000){
return 3;
}
if(gr>5000000){
return 2;
}
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
5480 KB |
Output is correct |
2 |
Correct |
41 ms |
5148 KB |
Output is correct |
3 |
Incorrect |
42 ms |
5672 KB |
Output isn't correct |
4 |
Correct |
11 ms |
3724 KB |
Output is correct |
5 |
Correct |
37 ms |
5324 KB |
Output is correct |
6 |
Incorrect |
35 ms |
4368 KB |
Output isn't correct |
7 |
Incorrect |
44 ms |
5316 KB |
Output isn't correct |
8 |
Correct |
32 ms |
5132 KB |
Output is correct |
9 |
Correct |
43 ms |
4528 KB |
Output is correct |
10 |
Correct |
38 ms |
5272 KB |
Output is correct |
11 |
Correct |
35 ms |
4380 KB |
Output is correct |
12 |
Correct |
39 ms |
4744 KB |
Output is correct |
13 |
Correct |
39 ms |
5228 KB |
Output is correct |
14 |
Correct |
28 ms |
3044 KB |
Output is correct |
15 |
Correct |
31 ms |
4688 KB |
Output is correct |
16 |
Incorrect |
39 ms |
4736 KB |
Output isn't correct |
17 |
Correct |
60 ms |
5816 KB |
Output is correct |
18 |
Incorrect |
33 ms |
4360 KB |
Output isn't correct |
19 |
Correct |
34 ms |
5028 KB |
Output is correct |
20 |
Correct |
25 ms |
4456 KB |
Output is correct |
21 |
Correct |
39 ms |
4852 KB |
Output is correct |
22 |
Correct |
32 ms |
5068 KB |
Output is correct |
23 |
Correct |
31 ms |
4664 KB |
Output is correct |
24 |
Correct |
27 ms |
3276 KB |
Output is correct |
25 |
Correct |
43 ms |
4888 KB |
Output is correct |
26 |
Correct |
40 ms |
5708 KB |
Output is correct |
27 |
Correct |
31 ms |
3944 KB |
Output is correct |
28 |
Correct |
35 ms |
4328 KB |
Output is correct |
29 |
Correct |
24 ms |
2996 KB |
Output is correct |
30 |
Incorrect |
37 ms |
5168 KB |
Output isn't correct |
31 |
Correct |
40 ms |
4304 KB |
Output is correct |
32 |
Correct |
43 ms |
4704 KB |
Output is correct |
33 |
Correct |
30 ms |
4688 KB |
Output is correct |
34 |
Incorrect |
55 ms |
5964 KB |
Output isn't correct |
35 |
Correct |
51 ms |
6084 KB |
Output is correct |
36 |
Correct |
51 ms |
5988 KB |
Output is correct |
37 |
Correct |
32 ms |
4656 KB |
Output is correct |
38 |
Correct |
41 ms |
4612 KB |
Output is correct |
39 |
Correct |
20 ms |
2628 KB |
Output is correct |
40 |
Correct |
35 ms |
4372 KB |
Output is correct |
41 |
Correct |
38 ms |
4248 KB |
Output is correct |
42 |
Incorrect |
39 ms |
5080 KB |
Output isn't correct |
43 |
Incorrect |
52 ms |
4904 KB |
Output isn't correct |
44 |
Correct |
42 ms |
5352 KB |
Output is correct |
45 |
Correct |
36 ms |
4580 KB |
Output is correct |
46 |
Correct |
56 ms |
5880 KB |
Output is correct |
47 |
Correct |
49 ms |
5972 KB |
Output is correct |
48 |
Correct |
35 ms |
4396 KB |
Output is correct |
49 |
Correct |
42 ms |
5364 KB |
Output is correct |
50 |
Correct |
45 ms |
5264 KB |
Output is correct |
51 |
Correct |
28 ms |
3532 KB |
Output is correct |
52 |
Incorrect |
49 ms |
5428 KB |
Output isn't correct |
53 |
Correct |
27 ms |
3072 KB |
Output is correct |
54 |
Correct |
31 ms |
4768 KB |
Output is correct |
55 |
Incorrect |
43 ms |
4620 KB |
Output isn't correct |
56 |
Correct |
31 ms |
3700 KB |
Output is correct |
57 |
Correct |
22 ms |
2444 KB |
Output is correct |
58 |
Correct |
31 ms |
4908 KB |
Output is correct |
59 |
Correct |
36 ms |
5184 KB |
Output is correct |
60 |
Incorrect |
56 ms |
5816 KB |
Output isn't correct |
61 |
Correct |
28 ms |
4736 KB |
Output is correct |
62 |
Incorrect |
29 ms |
3804 KB |
Output isn't correct |
63 |
Correct |
48 ms |
4748 KB |
Output is correct |
64 |
Correct |
54 ms |
5884 KB |
Output is correct |
65 |
Incorrect |
12 ms |
1328 KB |
Output isn't correct |
66 |
Correct |
48 ms |
5484 KB |
Output is correct |
67 |
Incorrect |
47 ms |
5208 KB |
Output isn't correct |
68 |
Correct |
43 ms |
4512 KB |
Output is correct |
69 |
Correct |
44 ms |
5888 KB |
Output is correct |
70 |
Correct |
20 ms |
2404 KB |
Output is correct |
71 |
Correct |
46 ms |
5936 KB |
Output is correct |
72 |
Correct |
38 ms |
4412 KB |
Output is correct |
73 |
Incorrect |
47 ms |
5652 KB |
Output isn't correct |
74 |
Correct |
41 ms |
5424 KB |
Output is correct |
75 |
Correct |
31 ms |
4980 KB |
Output is correct |
76 |
Correct |
36 ms |
5440 KB |
Output is correct |
77 |
Correct |
36 ms |
5296 KB |
Output is correct |
78 |
Correct |
42 ms |
5260 KB |
Output is correct |
79 |
Correct |
37 ms |
5300 KB |
Output is correct |
80 |
Correct |
36 ms |
4944 KB |
Output is correct |
81 |
Correct |
26 ms |
4548 KB |
Output is correct |
82 |
Correct |
34 ms |
4284 KB |
Output is correct |
83 |
Correct |
37 ms |
4752 KB |
Output is correct |
84 |
Incorrect |
43 ms |
5672 KB |
Output isn't correct |
85 |
Correct |
44 ms |
5716 KB |
Output is correct |
86 |
Correct |
42 ms |
5164 KB |
Output is correct |
87 |
Correct |
36 ms |
5412 KB |
Output is correct |
88 |
Incorrect |
34 ms |
4272 KB |
Output isn't correct |
89 |
Incorrect |
35 ms |
5068 KB |
Output isn't correct |
90 |
Correct |
29 ms |
3660 KB |
Output is correct |
91 |
Incorrect |
40 ms |
5852 KB |
Output isn't correct |
92 |
Correct |
53 ms |
5948 KB |
Output is correct |
93 |
Correct |
32 ms |
4924 KB |
Output is correct |
94 |
Correct |
39 ms |
5232 KB |
Output is correct |
95 |
Correct |
41 ms |
4188 KB |
Output is correct |
96 |
Incorrect |
44 ms |
5200 KB |
Output isn't correct |
97 |
Incorrect |
40 ms |
5288 KB |
Output isn't correct |
98 |
Incorrect |
41 ms |
4776 KB |
Output isn't correct |
99 |
Correct |
27 ms |
3040 KB |
Output is correct |
100 |
Correct |
49 ms |
5224 KB |
Output is correct |
101 |
Correct |
35 ms |
5100 KB |
Output is correct |
102 |
Correct |
29 ms |
4728 KB |
Output is correct |