#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define pill pair<ll, ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
const int N = 311 + 1;
const ll hsh[2] = {1555555699, 1222222763};
const ll P = 113;
ll n;
ll a[N], b[N], c[N];
int main() {
speed;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> a[i] >> b[i] >> c[i];
}
ll sum = -1;
for(int j = 0; j < n; j++) {
for(int i = 0; i < n; i++) {
for(int k = 0; k < n; k++) {
if(a[j] > max(a[i], a[k]) && b[i] > max(b[j], b[k]) && c[k] > max(c[j], c[i])) {
sum = max(sum, a[j] + b[i] + c[k]);
}
}
}
}
cout << sum;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
320 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
324 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
54 ms |
316 KB |
Output is correct |
15 |
Correct |
21 ms |
340 KB |
Output is correct |
16 |
Correct |
41 ms |
212 KB |
Output is correct |
17 |
Correct |
41 ms |
332 KB |
Output is correct |
18 |
Correct |
39 ms |
212 KB |
Output is correct |
19 |
Correct |
48 ms |
312 KB |
Output is correct |
20 |
Correct |
38 ms |
324 KB |
Output is correct |
21 |
Correct |
27 ms |
212 KB |
Output is correct |
22 |
Correct |
32 ms |
332 KB |
Output is correct |
23 |
Correct |
21 ms |
212 KB |
Output is correct |
24 |
Correct |
28 ms |
212 KB |
Output is correct |
25 |
Correct |
25 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
320 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
324 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
54 ms |
316 KB |
Output is correct |
15 |
Correct |
21 ms |
340 KB |
Output is correct |
16 |
Correct |
41 ms |
212 KB |
Output is correct |
17 |
Correct |
41 ms |
332 KB |
Output is correct |
18 |
Correct |
39 ms |
212 KB |
Output is correct |
19 |
Correct |
48 ms |
312 KB |
Output is correct |
20 |
Correct |
38 ms |
324 KB |
Output is correct |
21 |
Correct |
27 ms |
212 KB |
Output is correct |
22 |
Correct |
32 ms |
332 KB |
Output is correct |
23 |
Correct |
21 ms |
212 KB |
Output is correct |
24 |
Correct |
28 ms |
212 KB |
Output is correct |
25 |
Correct |
25 ms |
212 KB |
Output is correct |
26 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 11 |
27 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
328 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
328 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
328 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
328 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
324 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
320 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
324 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
54 ms |
316 KB |
Output is correct |
15 |
Correct |
21 ms |
340 KB |
Output is correct |
16 |
Correct |
41 ms |
212 KB |
Output is correct |
17 |
Correct |
41 ms |
332 KB |
Output is correct |
18 |
Correct |
39 ms |
212 KB |
Output is correct |
19 |
Correct |
48 ms |
312 KB |
Output is correct |
20 |
Correct |
38 ms |
324 KB |
Output is correct |
21 |
Correct |
27 ms |
212 KB |
Output is correct |
22 |
Correct |
32 ms |
332 KB |
Output is correct |
23 |
Correct |
21 ms |
212 KB |
Output is correct |
24 |
Correct |
28 ms |
212 KB |
Output is correct |
25 |
Correct |
25 ms |
212 KB |
Output is correct |
26 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 11 |
27 |
Halted |
0 ms |
0 KB |
- |