#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
int N, arr[303][303][303], ans = -1;
signed main()
{
cin >> N;
for(int i = 1; i <= N; i++)
{
int x, y, z;
cin >> x >> y >> z;
arr[x][y][z] = 1;
}
const int C = 300;
for(int i = 1; i <= C; i++)
for(int j = 1; j <= C; j++)
for(int k = 1; k <= C; k++)
arr[i][j][k] = arr[i][j][k] +
arr[i - 1][j][k] + arr[i][j - 1][k] + arr[i][j][k - 1] +
-arr[i - 1][j - 1][k] - arr[i - 1][j][k - 1] - arr[i][j - 1][k - 1] +
arr[i - 1][j - 1][k - 1];
for(int i = 1; i <= C; i++)
for(int j = 1; j <= C; j++)
for(int k = 1; k <= C; k++)
if(arr[i][j - 1][k - 1] - arr[i - 1][j - 1][k - 1] > 0 &&
arr[i - 1][j][k - 1] - arr[i - 1][j - 1][k - 1] > 0 &&
arr[i - 1][j - 1][k] - arr[i - 1][j - 1][k - 1] > 0)
ans = max(ans, i + j + k);
cout << ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
185 ms |
108000 KB |
Output is correct |
2 |
Correct |
190 ms |
108080 KB |
Output is correct |
3 |
Correct |
187 ms |
108024 KB |
Output is correct |
4 |
Correct |
187 ms |
108204 KB |
Output is correct |
5 |
Correct |
189 ms |
108056 KB |
Output is correct |
6 |
Correct |
203 ms |
108188 KB |
Output is correct |
7 |
Correct |
202 ms |
108080 KB |
Output is correct |
8 |
Correct |
190 ms |
107980 KB |
Output is correct |
9 |
Correct |
203 ms |
108096 KB |
Output is correct |
10 |
Correct |
190 ms |
108140 KB |
Output is correct |
11 |
Correct |
190 ms |
108120 KB |
Output is correct |
12 |
Correct |
197 ms |
108020 KB |
Output is correct |
13 |
Correct |
187 ms |
108060 KB |
Output is correct |
14 |
Runtime error |
2 ms |
340 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
185 ms |
108000 KB |
Output is correct |
2 |
Correct |
190 ms |
108080 KB |
Output is correct |
3 |
Correct |
187 ms |
108024 KB |
Output is correct |
4 |
Correct |
187 ms |
108204 KB |
Output is correct |
5 |
Correct |
189 ms |
108056 KB |
Output is correct |
6 |
Correct |
203 ms |
108188 KB |
Output is correct |
7 |
Correct |
202 ms |
108080 KB |
Output is correct |
8 |
Correct |
190 ms |
107980 KB |
Output is correct |
9 |
Correct |
203 ms |
108096 KB |
Output is correct |
10 |
Correct |
190 ms |
108140 KB |
Output is correct |
11 |
Correct |
190 ms |
108120 KB |
Output is correct |
12 |
Correct |
197 ms |
108020 KB |
Output is correct |
13 |
Correct |
187 ms |
108060 KB |
Output is correct |
14 |
Runtime error |
2 ms |
340 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
196 ms |
108084 KB |
Output is correct |
2 |
Correct |
195 ms |
108072 KB |
Output is correct |
3 |
Correct |
189 ms |
108140 KB |
Output is correct |
4 |
Correct |
186 ms |
107984 KB |
Output is correct |
5 |
Correct |
217 ms |
108144 KB |
Output is correct |
6 |
Correct |
204 ms |
108076 KB |
Output is correct |
7 |
Correct |
189 ms |
108008 KB |
Output is correct |
8 |
Correct |
189 ms |
108016 KB |
Output is correct |
9 |
Correct |
189 ms |
108036 KB |
Output is correct |
10 |
Correct |
198 ms |
108076 KB |
Output is correct |
11 |
Correct |
239 ms |
107996 KB |
Output is correct |
12 |
Correct |
225 ms |
108112 KB |
Output is correct |
13 |
Correct |
237 ms |
108068 KB |
Output is correct |
14 |
Correct |
263 ms |
108080 KB |
Output is correct |
15 |
Correct |
244 ms |
108096 KB |
Output is correct |
16 |
Correct |
247 ms |
108024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
196 ms |
108084 KB |
Output is correct |
2 |
Correct |
195 ms |
108072 KB |
Output is correct |
3 |
Correct |
189 ms |
108140 KB |
Output is correct |
4 |
Correct |
186 ms |
107984 KB |
Output is correct |
5 |
Correct |
217 ms |
108144 KB |
Output is correct |
6 |
Correct |
204 ms |
108076 KB |
Output is correct |
7 |
Correct |
189 ms |
108008 KB |
Output is correct |
8 |
Correct |
189 ms |
108016 KB |
Output is correct |
9 |
Correct |
189 ms |
108036 KB |
Output is correct |
10 |
Correct |
198 ms |
108076 KB |
Output is correct |
11 |
Correct |
239 ms |
107996 KB |
Output is correct |
12 |
Correct |
225 ms |
108112 KB |
Output is correct |
13 |
Correct |
237 ms |
108068 KB |
Output is correct |
14 |
Correct |
263 ms |
108080 KB |
Output is correct |
15 |
Correct |
244 ms |
108096 KB |
Output is correct |
16 |
Correct |
247 ms |
108024 KB |
Output is correct |
17 |
Correct |
190 ms |
107972 KB |
Output is correct |
18 |
Correct |
191 ms |
108044 KB |
Output is correct |
19 |
Correct |
191 ms |
108012 KB |
Output is correct |
20 |
Correct |
191 ms |
108000 KB |
Output is correct |
21 |
Correct |
193 ms |
108116 KB |
Output is correct |
22 |
Correct |
261 ms |
108096 KB |
Output is correct |
23 |
Correct |
243 ms |
107976 KB |
Output is correct |
24 |
Correct |
236 ms |
107992 KB |
Output is correct |
25 |
Correct |
260 ms |
108156 KB |
Output is correct |
26 |
Correct |
260 ms |
107980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
196 ms |
108084 KB |
Output is correct |
2 |
Correct |
195 ms |
108072 KB |
Output is correct |
3 |
Correct |
189 ms |
108140 KB |
Output is correct |
4 |
Correct |
186 ms |
107984 KB |
Output is correct |
5 |
Correct |
217 ms |
108144 KB |
Output is correct |
6 |
Correct |
204 ms |
108076 KB |
Output is correct |
7 |
Correct |
189 ms |
108008 KB |
Output is correct |
8 |
Correct |
189 ms |
108016 KB |
Output is correct |
9 |
Correct |
189 ms |
108036 KB |
Output is correct |
10 |
Correct |
198 ms |
108076 KB |
Output is correct |
11 |
Correct |
239 ms |
107996 KB |
Output is correct |
12 |
Correct |
225 ms |
108112 KB |
Output is correct |
13 |
Correct |
237 ms |
108068 KB |
Output is correct |
14 |
Correct |
263 ms |
108080 KB |
Output is correct |
15 |
Correct |
244 ms |
108096 KB |
Output is correct |
16 |
Correct |
247 ms |
108024 KB |
Output is correct |
17 |
Correct |
190 ms |
107972 KB |
Output is correct |
18 |
Correct |
191 ms |
108044 KB |
Output is correct |
19 |
Correct |
191 ms |
108012 KB |
Output is correct |
20 |
Correct |
191 ms |
108000 KB |
Output is correct |
21 |
Correct |
193 ms |
108116 KB |
Output is correct |
22 |
Correct |
261 ms |
108096 KB |
Output is correct |
23 |
Correct |
243 ms |
107976 KB |
Output is correct |
24 |
Correct |
236 ms |
107992 KB |
Output is correct |
25 |
Correct |
260 ms |
108156 KB |
Output is correct |
26 |
Correct |
260 ms |
107980 KB |
Output is correct |
27 |
Correct |
190 ms |
108076 KB |
Output is correct |
28 |
Correct |
195 ms |
108112 KB |
Output is correct |
29 |
Correct |
200 ms |
107984 KB |
Output is correct |
30 |
Correct |
193 ms |
108016 KB |
Output is correct |
31 |
Correct |
192 ms |
107968 KB |
Output is correct |
32 |
Correct |
190 ms |
107980 KB |
Output is correct |
33 |
Correct |
190 ms |
108080 KB |
Output is correct |
34 |
Correct |
277 ms |
108008 KB |
Output is correct |
35 |
Correct |
275 ms |
108148 KB |
Output is correct |
36 |
Correct |
273 ms |
108080 KB |
Output is correct |
37 |
Correct |
273 ms |
108072 KB |
Output is correct |
38 |
Correct |
278 ms |
108080 KB |
Output is correct |
39 |
Correct |
235 ms |
107956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
196 ms |
108084 KB |
Output is correct |
2 |
Correct |
195 ms |
108072 KB |
Output is correct |
3 |
Correct |
189 ms |
108140 KB |
Output is correct |
4 |
Correct |
186 ms |
107984 KB |
Output is correct |
5 |
Correct |
217 ms |
108144 KB |
Output is correct |
6 |
Correct |
204 ms |
108076 KB |
Output is correct |
7 |
Correct |
189 ms |
108008 KB |
Output is correct |
8 |
Correct |
189 ms |
108016 KB |
Output is correct |
9 |
Correct |
189 ms |
108036 KB |
Output is correct |
10 |
Correct |
198 ms |
108076 KB |
Output is correct |
11 |
Correct |
239 ms |
107996 KB |
Output is correct |
12 |
Correct |
225 ms |
108112 KB |
Output is correct |
13 |
Correct |
237 ms |
108068 KB |
Output is correct |
14 |
Correct |
263 ms |
108080 KB |
Output is correct |
15 |
Correct |
244 ms |
108096 KB |
Output is correct |
16 |
Correct |
247 ms |
108024 KB |
Output is correct |
17 |
Correct |
190 ms |
107972 KB |
Output is correct |
18 |
Correct |
191 ms |
108044 KB |
Output is correct |
19 |
Correct |
191 ms |
108012 KB |
Output is correct |
20 |
Correct |
191 ms |
108000 KB |
Output is correct |
21 |
Correct |
193 ms |
108116 KB |
Output is correct |
22 |
Correct |
261 ms |
108096 KB |
Output is correct |
23 |
Correct |
243 ms |
107976 KB |
Output is correct |
24 |
Correct |
236 ms |
107992 KB |
Output is correct |
25 |
Correct |
260 ms |
108156 KB |
Output is correct |
26 |
Correct |
260 ms |
107980 KB |
Output is correct |
27 |
Correct |
190 ms |
108076 KB |
Output is correct |
28 |
Correct |
195 ms |
108112 KB |
Output is correct |
29 |
Correct |
200 ms |
107984 KB |
Output is correct |
30 |
Correct |
193 ms |
108016 KB |
Output is correct |
31 |
Correct |
192 ms |
107968 KB |
Output is correct |
32 |
Correct |
190 ms |
107980 KB |
Output is correct |
33 |
Correct |
190 ms |
108080 KB |
Output is correct |
34 |
Correct |
277 ms |
108008 KB |
Output is correct |
35 |
Correct |
275 ms |
108148 KB |
Output is correct |
36 |
Correct |
273 ms |
108080 KB |
Output is correct |
37 |
Correct |
273 ms |
108072 KB |
Output is correct |
38 |
Correct |
278 ms |
108080 KB |
Output is correct |
39 |
Correct |
235 ms |
107956 KB |
Output is correct |
40 |
Runtime error |
2 ms |
340 KB |
Execution killed with signal 11 |
41 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
185 ms |
108000 KB |
Output is correct |
2 |
Correct |
190 ms |
108080 KB |
Output is correct |
3 |
Correct |
187 ms |
108024 KB |
Output is correct |
4 |
Correct |
187 ms |
108204 KB |
Output is correct |
5 |
Correct |
189 ms |
108056 KB |
Output is correct |
6 |
Correct |
203 ms |
108188 KB |
Output is correct |
7 |
Correct |
202 ms |
108080 KB |
Output is correct |
8 |
Correct |
190 ms |
107980 KB |
Output is correct |
9 |
Correct |
203 ms |
108096 KB |
Output is correct |
10 |
Correct |
190 ms |
108140 KB |
Output is correct |
11 |
Correct |
190 ms |
108120 KB |
Output is correct |
12 |
Correct |
197 ms |
108020 KB |
Output is correct |
13 |
Correct |
187 ms |
108060 KB |
Output is correct |
14 |
Runtime error |
2 ms |
340 KB |
Execution killed with signal 11 |
15 |
Halted |
0 ms |
0 KB |
- |