#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include<bits/extc++.h>
//__gnu_pbds
const int N = 305;
int Xsum[N][N][N];
int Ysum[N][N][N];
int Zsum[N][N][N];
int main(){
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n;cin>>n;
for(int i=0;i<n;i++){
int a,b,c;cin>>a>>b>>c;
Xsum[a][b][c]++;
Ysum[b][a][c]++;
Zsum[c][a][b]++;
}
for(int i=1;i<N;i++){
for(int j=1;j<N;j++){
for(int k=1;k<N;k++){
Xsum[i][j][k] = Xsum[i][j][k]+Xsum[i][j-1][k]+Xsum[i][j][k-1]-Xsum[i][j-1][k-1];
Ysum[i][j][k] = Ysum[i][j][k]+Ysum[i][j-1][k]+Ysum[i][j][k-1]-Ysum[i][j-1][k-1];
Zsum[i][j][k] = Zsum[i][j][k]+Zsum[i][j-1][k]+Zsum[i][j][k-1]-Zsum[i][j-1][k-1];
}
}
}
int ans = -1;
for(int i=1;i<N;i++){
for(int j=1;j<N;j++){
for(int k=1;k<N;k++){
if(Xsum[i][j-1][k-1] && Ysum[j][i-1][k-1] && Zsum[k][i-1][j-1]) ans = max(ans,i+j+k);
}
}
}
cout<<ans<<"\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
218 ms |
333392 KB |
Output is correct |
2 |
Correct |
217 ms |
333392 KB |
Output is correct |
3 |
Correct |
220 ms |
333620 KB |
Output is correct |
4 |
Correct |
223 ms |
333644 KB |
Output is correct |
5 |
Correct |
221 ms |
333388 KB |
Output is correct |
6 |
Correct |
219 ms |
333368 KB |
Output is correct |
7 |
Correct |
224 ms |
333652 KB |
Output is correct |
8 |
Correct |
219 ms |
333384 KB |
Output is correct |
9 |
Correct |
225 ms |
333140 KB |
Output is correct |
10 |
Correct |
229 ms |
333596 KB |
Output is correct |
11 |
Correct |
221 ms |
332472 KB |
Output is correct |
12 |
Correct |
219 ms |
332624 KB |
Output is correct |
13 |
Correct |
226 ms |
333000 KB |
Output is correct |
14 |
Runtime error |
7 ms |
604 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
218 ms |
333392 KB |
Output is correct |
2 |
Correct |
217 ms |
333392 KB |
Output is correct |
3 |
Correct |
220 ms |
333620 KB |
Output is correct |
4 |
Correct |
223 ms |
333644 KB |
Output is correct |
5 |
Correct |
221 ms |
333388 KB |
Output is correct |
6 |
Correct |
219 ms |
333368 KB |
Output is correct |
7 |
Correct |
224 ms |
333652 KB |
Output is correct |
8 |
Correct |
219 ms |
333384 KB |
Output is correct |
9 |
Correct |
225 ms |
333140 KB |
Output is correct |
10 |
Correct |
229 ms |
333596 KB |
Output is correct |
11 |
Correct |
221 ms |
332472 KB |
Output is correct |
12 |
Correct |
219 ms |
332624 KB |
Output is correct |
13 |
Correct |
226 ms |
333000 KB |
Output is correct |
14 |
Runtime error |
7 ms |
604 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
221 ms |
333312 KB |
Output is correct |
2 |
Correct |
219 ms |
333272 KB |
Output is correct |
3 |
Correct |
220 ms |
333388 KB |
Output is correct |
4 |
Correct |
218 ms |
333140 KB |
Output is correct |
5 |
Correct |
220 ms |
333392 KB |
Output is correct |
6 |
Correct |
222 ms |
333292 KB |
Output is correct |
7 |
Correct |
219 ms |
333320 KB |
Output is correct |
8 |
Correct |
220 ms |
333692 KB |
Output is correct |
9 |
Correct |
220 ms |
333232 KB |
Output is correct |
10 |
Correct |
219 ms |
333340 KB |
Output is correct |
11 |
Correct |
241 ms |
333240 KB |
Output is correct |
12 |
Correct |
230 ms |
333912 KB |
Output is correct |
13 |
Correct |
235 ms |
333908 KB |
Output is correct |
14 |
Correct |
238 ms |
334420 KB |
Output is correct |
15 |
Correct |
237 ms |
334132 KB |
Output is correct |
16 |
Correct |
235 ms |
334132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
221 ms |
333312 KB |
Output is correct |
2 |
Correct |
219 ms |
333272 KB |
Output is correct |
3 |
Correct |
220 ms |
333388 KB |
Output is correct |
4 |
Correct |
218 ms |
333140 KB |
Output is correct |
5 |
Correct |
220 ms |
333392 KB |
Output is correct |
6 |
Correct |
222 ms |
333292 KB |
Output is correct |
7 |
Correct |
219 ms |
333320 KB |
Output is correct |
8 |
Correct |
220 ms |
333692 KB |
Output is correct |
9 |
Correct |
220 ms |
333232 KB |
Output is correct |
10 |
Correct |
219 ms |
333340 KB |
Output is correct |
11 |
Correct |
241 ms |
333240 KB |
Output is correct |
12 |
Correct |
230 ms |
333912 KB |
Output is correct |
13 |
Correct |
235 ms |
333908 KB |
Output is correct |
14 |
Correct |
238 ms |
334420 KB |
Output is correct |
15 |
Correct |
237 ms |
334132 KB |
Output is correct |
16 |
Correct |
235 ms |
334132 KB |
Output is correct |
17 |
Correct |
218 ms |
332628 KB |
Output is correct |
18 |
Correct |
218 ms |
332624 KB |
Output is correct |
19 |
Correct |
222 ms |
333200 KB |
Output is correct |
20 |
Correct |
217 ms |
333396 KB |
Output is correct |
21 |
Correct |
215 ms |
333360 KB |
Output is correct |
22 |
Correct |
240 ms |
334640 KB |
Output is correct |
23 |
Correct |
233 ms |
334160 KB |
Output is correct |
24 |
Correct |
227 ms |
334148 KB |
Output is correct |
25 |
Correct |
235 ms |
334332 KB |
Output is correct |
26 |
Correct |
237 ms |
334388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
221 ms |
333312 KB |
Output is correct |
2 |
Correct |
219 ms |
333272 KB |
Output is correct |
3 |
Correct |
220 ms |
333388 KB |
Output is correct |
4 |
Correct |
218 ms |
333140 KB |
Output is correct |
5 |
Correct |
220 ms |
333392 KB |
Output is correct |
6 |
Correct |
222 ms |
333292 KB |
Output is correct |
7 |
Correct |
219 ms |
333320 KB |
Output is correct |
8 |
Correct |
220 ms |
333692 KB |
Output is correct |
9 |
Correct |
220 ms |
333232 KB |
Output is correct |
10 |
Correct |
219 ms |
333340 KB |
Output is correct |
11 |
Correct |
241 ms |
333240 KB |
Output is correct |
12 |
Correct |
230 ms |
333912 KB |
Output is correct |
13 |
Correct |
235 ms |
333908 KB |
Output is correct |
14 |
Correct |
238 ms |
334420 KB |
Output is correct |
15 |
Correct |
237 ms |
334132 KB |
Output is correct |
16 |
Correct |
235 ms |
334132 KB |
Output is correct |
17 |
Correct |
218 ms |
332628 KB |
Output is correct |
18 |
Correct |
218 ms |
332624 KB |
Output is correct |
19 |
Correct |
222 ms |
333200 KB |
Output is correct |
20 |
Correct |
217 ms |
333396 KB |
Output is correct |
21 |
Correct |
215 ms |
333360 KB |
Output is correct |
22 |
Correct |
240 ms |
334640 KB |
Output is correct |
23 |
Correct |
233 ms |
334160 KB |
Output is correct |
24 |
Correct |
227 ms |
334148 KB |
Output is correct |
25 |
Correct |
235 ms |
334332 KB |
Output is correct |
26 |
Correct |
237 ms |
334388 KB |
Output is correct |
27 |
Correct |
172 ms |
333524 KB |
Output is correct |
28 |
Correct |
191 ms |
333392 KB |
Output is correct |
29 |
Correct |
195 ms |
333396 KB |
Output is correct |
30 |
Correct |
193 ms |
333396 KB |
Output is correct |
31 |
Correct |
178 ms |
332488 KB |
Output is correct |
32 |
Correct |
170 ms |
333396 KB |
Output is correct |
33 |
Correct |
173 ms |
333416 KB |
Output is correct |
34 |
Correct |
223 ms |
334676 KB |
Output is correct |
35 |
Correct |
224 ms |
334260 KB |
Output is correct |
36 |
Correct |
235 ms |
335248 KB |
Output is correct |
37 |
Correct |
222 ms |
334476 KB |
Output is correct |
38 |
Correct |
181 ms |
334916 KB |
Output is correct |
39 |
Correct |
171 ms |
334004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
221 ms |
333312 KB |
Output is correct |
2 |
Correct |
219 ms |
333272 KB |
Output is correct |
3 |
Correct |
220 ms |
333388 KB |
Output is correct |
4 |
Correct |
218 ms |
333140 KB |
Output is correct |
5 |
Correct |
220 ms |
333392 KB |
Output is correct |
6 |
Correct |
222 ms |
333292 KB |
Output is correct |
7 |
Correct |
219 ms |
333320 KB |
Output is correct |
8 |
Correct |
220 ms |
333692 KB |
Output is correct |
9 |
Correct |
220 ms |
333232 KB |
Output is correct |
10 |
Correct |
219 ms |
333340 KB |
Output is correct |
11 |
Correct |
241 ms |
333240 KB |
Output is correct |
12 |
Correct |
230 ms |
333912 KB |
Output is correct |
13 |
Correct |
235 ms |
333908 KB |
Output is correct |
14 |
Correct |
238 ms |
334420 KB |
Output is correct |
15 |
Correct |
237 ms |
334132 KB |
Output is correct |
16 |
Correct |
235 ms |
334132 KB |
Output is correct |
17 |
Correct |
218 ms |
332628 KB |
Output is correct |
18 |
Correct |
218 ms |
332624 KB |
Output is correct |
19 |
Correct |
222 ms |
333200 KB |
Output is correct |
20 |
Correct |
217 ms |
333396 KB |
Output is correct |
21 |
Correct |
215 ms |
333360 KB |
Output is correct |
22 |
Correct |
240 ms |
334640 KB |
Output is correct |
23 |
Correct |
233 ms |
334160 KB |
Output is correct |
24 |
Correct |
227 ms |
334148 KB |
Output is correct |
25 |
Correct |
235 ms |
334332 KB |
Output is correct |
26 |
Correct |
237 ms |
334388 KB |
Output is correct |
27 |
Correct |
172 ms |
333524 KB |
Output is correct |
28 |
Correct |
191 ms |
333392 KB |
Output is correct |
29 |
Correct |
195 ms |
333396 KB |
Output is correct |
30 |
Correct |
193 ms |
333396 KB |
Output is correct |
31 |
Correct |
178 ms |
332488 KB |
Output is correct |
32 |
Correct |
170 ms |
333396 KB |
Output is correct |
33 |
Correct |
173 ms |
333416 KB |
Output is correct |
34 |
Correct |
223 ms |
334676 KB |
Output is correct |
35 |
Correct |
224 ms |
334260 KB |
Output is correct |
36 |
Correct |
235 ms |
335248 KB |
Output is correct |
37 |
Correct |
222 ms |
334476 KB |
Output is correct |
38 |
Correct |
181 ms |
334916 KB |
Output is correct |
39 |
Correct |
171 ms |
334004 KB |
Output is correct |
40 |
Runtime error |
7 ms |
600 KB |
Execution killed with signal 11 |
41 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
218 ms |
333392 KB |
Output is correct |
2 |
Correct |
217 ms |
333392 KB |
Output is correct |
3 |
Correct |
220 ms |
333620 KB |
Output is correct |
4 |
Correct |
223 ms |
333644 KB |
Output is correct |
5 |
Correct |
221 ms |
333388 KB |
Output is correct |
6 |
Correct |
219 ms |
333368 KB |
Output is correct |
7 |
Correct |
224 ms |
333652 KB |
Output is correct |
8 |
Correct |
219 ms |
333384 KB |
Output is correct |
9 |
Correct |
225 ms |
333140 KB |
Output is correct |
10 |
Correct |
229 ms |
333596 KB |
Output is correct |
11 |
Correct |
221 ms |
332472 KB |
Output is correct |
12 |
Correct |
219 ms |
332624 KB |
Output is correct |
13 |
Correct |
226 ms |
333000 KB |
Output is correct |
14 |
Runtime error |
7 ms |
604 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |