#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,gr2=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+=(dz<=500);
}
int z=max(0,G[i][j]-max(R[i][j],B[i][j]));
gr+=1ll*z*z*z;
gr2+=1ll*z*z;
}
}
cout << dif << ' ' << gr << ' ' << dif2 << " " << gr2 << "\n";
if(dif<100000000){
return 4;
}
else if(dif>2000000000){
return 3;
}
if(gr2>5000000 || dif2<700000){
return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
44 ms |
3072 KB |
Output isn't correct |
2 |
Incorrect |
43 ms |
2976 KB |
Output isn't correct |
3 |
Incorrect |
52 ms |
3468 KB |
Output isn't correct |
4 |
Incorrect |
40 ms |
2720 KB |
Output isn't correct |
5 |
Incorrect |
46 ms |
3464 KB |
Output isn't correct |
6 |
Incorrect |
44 ms |
3468 KB |
Output isn't correct |
7 |
Incorrect |
45 ms |
3484 KB |
Output isn't correct |
8 |
Incorrect |
46 ms |
2708 KB |
Output isn't correct |
9 |
Incorrect |
43 ms |
2772 KB |
Output isn't correct |
10 |
Incorrect |
45 ms |
2988 KB |
Output isn't correct |
11 |
Incorrect |
72 ms |
2708 KB |
Output isn't correct |
12 |
Incorrect |
21 ms |
1752 KB |
Output isn't correct |
13 |
Incorrect |
38 ms |
2444 KB |
Output isn't correct |
14 |
Incorrect |
46 ms |
3400 KB |
Output isn't correct |
15 |
Incorrect |
41 ms |
2740 KB |
Output isn't correct |
16 |
Incorrect |
39 ms |
2640 KB |
Output isn't correct |
17 |
Incorrect |
44 ms |
3480 KB |
Output isn't correct |
18 |
Incorrect |
40 ms |
2776 KB |
Output isn't correct |
19 |
Incorrect |
61 ms |
3472 KB |
Output isn't correct |
20 |
Incorrect |
43 ms |
2908 KB |
Output isn't correct |
21 |
Incorrect |
39 ms |
2432 KB |
Output isn't correct |
22 |
Incorrect |
54 ms |
3220 KB |
Output isn't correct |
23 |
Incorrect |
40 ms |
2848 KB |
Output isn't correct |
24 |
Incorrect |
33 ms |
2352 KB |
Output isn't correct |
25 |
Incorrect |
44 ms |
3408 KB |
Output isn't correct |
26 |
Incorrect |
40 ms |
2932 KB |
Output isn't correct |
27 |
Incorrect |
40 ms |
2864 KB |
Output isn't correct |
28 |
Incorrect |
47 ms |
3092 KB |
Output isn't correct |
29 |
Incorrect |
45 ms |
3468 KB |
Output isn't correct |
30 |
Incorrect |
36 ms |
3436 KB |
Output isn't correct |
31 |
Incorrect |
46 ms |
3472 KB |
Output isn't correct |
32 |
Incorrect |
47 ms |
3448 KB |
Output isn't correct |
33 |
Incorrect |
58 ms |
3372 KB |
Output isn't correct |
34 |
Incorrect |
40 ms |
3376 KB |
Output isn't correct |
35 |
Incorrect |
52 ms |
3396 KB |
Output isn't correct |
36 |
Incorrect |
33 ms |
3404 KB |
Output isn't correct |
37 |
Incorrect |
47 ms |
3376 KB |
Output isn't correct |
38 |
Incorrect |
44 ms |
3444 KB |
Output isn't correct |
39 |
Incorrect |
40 ms |
3420 KB |
Output isn't correct |
40 |
Incorrect |
41 ms |
3404 KB |
Output isn't correct |
41 |
Incorrect |
57 ms |
3376 KB |
Output isn't correct |
42 |
Incorrect |
39 ms |
3480 KB |
Output isn't correct |
43 |
Incorrect |
56 ms |
3460 KB |
Output isn't correct |
44 |
Incorrect |
59 ms |
3364 KB |
Output isn't correct |
45 |
Incorrect |
39 ms |
2632 KB |
Output isn't correct |
46 |
Incorrect |
38 ms |
3416 KB |
Output isn't correct |
47 |
Incorrect |
37 ms |
2740 KB |
Output isn't correct |
48 |
Incorrect |
43 ms |
2932 KB |
Output isn't correct |
49 |
Incorrect |
48 ms |
2920 KB |
Output isn't correct |
50 |
Incorrect |
14 ms |
3396 KB |
Output isn't correct |
51 |
Incorrect |
46 ms |
3476 KB |
Output isn't correct |
52 |
Incorrect |
60 ms |
3408 KB |
Output isn't correct |
53 |
Incorrect |
29 ms |
2024 KB |
Output isn't correct |
54 |
Incorrect |
43 ms |
3360 KB |
Output isn't correct |
55 |
Incorrect |
49 ms |
3484 KB |
Output isn't correct |
56 |
Incorrect |
51 ms |
3444 KB |
Output isn't correct |
57 |
Incorrect |
22 ms |
1756 KB |
Output isn't correct |
58 |
Incorrect |
60 ms |
3464 KB |
Output isn't correct |
59 |
Incorrect |
46 ms |
2980 KB |
Output isn't correct |
60 |
Incorrect |
39 ms |
3544 KB |
Output isn't correct |
61 |
Incorrect |
42 ms |
3468 KB |
Output isn't correct |
62 |
Incorrect |
36 ms |
3468 KB |
Output isn't correct |
63 |
Incorrect |
41 ms |
2872 KB |
Output isn't correct |
64 |
Incorrect |
60 ms |
3440 KB |
Output isn't correct |
65 |
Incorrect |
50 ms |
3324 KB |
Output isn't correct |
66 |
Incorrect |
54 ms |
3476 KB |
Output isn't correct |
67 |
Incorrect |
44 ms |
2404 KB |
Output isn't correct |
68 |
Incorrect |
66 ms |
3048 KB |
Output isn't correct |
69 |
Incorrect |
43 ms |
3460 KB |
Output isn't correct |
70 |
Incorrect |
43 ms |
2896 KB |
Output isn't correct |
71 |
Incorrect |
59 ms |
3384 KB |
Output isn't correct |
72 |
Incorrect |
42 ms |
2792 KB |
Output isn't correct |
73 |
Incorrect |
32 ms |
3524 KB |
Output isn't correct |
74 |
Incorrect |
39 ms |
3448 KB |
Output isn't correct |
75 |
Incorrect |
38 ms |
2692 KB |
Output isn't correct |
76 |
Incorrect |
45 ms |
3464 KB |
Output isn't correct |
77 |
Incorrect |
30 ms |
2036 KB |
Output isn't correct |
78 |
Incorrect |
12 ms |
1072 KB |
Output isn't correct |
79 |
Incorrect |
21 ms |
1680 KB |
Output isn't correct |
80 |
Incorrect |
35 ms |
2216 KB |
Output isn't correct |
81 |
Incorrect |
30 ms |
2068 KB |
Output isn't correct |
82 |
Incorrect |
62 ms |
3356 KB |
Output isn't correct |
83 |
Incorrect |
50 ms |
2968 KB |
Output isn't correct |
84 |
Incorrect |
49 ms |
3456 KB |
Output isn't correct |
85 |
Incorrect |
25 ms |
3428 KB |
Output isn't correct |
86 |
Incorrect |
45 ms |
3408 KB |
Output isn't correct |
87 |
Incorrect |
29 ms |
1980 KB |
Output isn't correct |
88 |
Incorrect |
42 ms |
3468 KB |
Output isn't correct |
89 |
Incorrect |
33 ms |
2044 KB |
Output isn't correct |
90 |
Incorrect |
32 ms |
3432 KB |
Output isn't correct |
91 |
Incorrect |
67 ms |
3472 KB |
Output isn't correct |
92 |
Incorrect |
59 ms |
3472 KB |
Output isn't correct |
93 |
Incorrect |
59 ms |
2980 KB |
Output isn't correct |
94 |
Incorrect |
39 ms |
3544 KB |
Output isn't correct |
95 |
Incorrect |
52 ms |
2808 KB |
Output isn't correct |
96 |
Incorrect |
50 ms |
3456 KB |
Output isn't correct |
97 |
Incorrect |
44 ms |
3356 KB |
Output isn't correct |
98 |
Incorrect |
41 ms |
3400 KB |
Output isn't correct |
99 |
Incorrect |
35 ms |
3456 KB |
Output isn't correct |
100 |
Incorrect |
33 ms |
3384 KB |
Output isn't correct |
101 |
Incorrect |
38 ms |
3460 KB |
Output isn't correct |
102 |
Incorrect |
45 ms |
3472 KB |
Output isn't correct |