Submission #850339

# Submission time Handle Problem Language Result Execution time Memory
850339 2023-09-16T12:09:09 Z niter Team Contest (JOI22_team) C++14
8 / 100
2000 ms 2896 KB
#include <bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pii pair<int,int>
#define pb push_back
#define ins insert
#define ff first
#define ss second
#define opa(x) cout << #x << " = " << x << ", ";
#define op(x) cout << #x << " = " << x << "\n";
#define ops(x) cout << x;
#define entr cout << '\n';
#define spac cout << ' ';
#define all(x) (x).begin(), (x).end()
#define STL(x) cout << #x << " : "; for(auto &qwe:x) cout << qwe << ' '; cout << '\n';
#define deb1 cout << "deb1" << endl;
#define deb2 cout << "deb2" << endl;
#define deb3 cout << "deb3" << endl;
#define deb4 cout << "deb4" << endl;
#define deb5 cout << "deb5" << endl;
using namespace std;
typedef long long ll;

struct pp{
    int x, y, z;
    void read(){
        cin >> x >> y >> z;
    }
    string res(){
        return "[" + to_string(x) + ", " + to_string(y) + ", " + to_string(z) + "]";
    }
    bool operator<(pp A){
        return (x == A.x) ? ( (y == A.y) ? (z > A.z) : (y > A.y) ) : (x > A.x);
    }
};

void solve(){
    int n; cin >> n;
    vector<pp> v(n);
    loop(i,0,n){
        v[i].read();
    }
//    loop(i,0,n){
//        op(v[i].res());
//    }
    sort(all(v));
    int ans = -1;
    loop(i,0,n){
        loop(j,i+1,n){
            loop(k,j+1,n){
                if(j == k) continue;
                pp tmp1 = v[j];
                pp tmp2 = v[k];
                if(tmp1.y == tmp2.y || tmp1.z == tmp2.z) continue;
                if(tmp1.y < tmp2.y) swap(tmp1, tmp2);
                if(v[i].x > v[j].x && v[i].x > v[k].x && tmp1.y > tmp2.y && tmp1.y > v[i].y
                   && tmp2.z > tmp1.z && tmp2.z > v[i].z){
                        ans = max(ans, v[i].x + tmp1.y + tmp2.z);
                }
            }
        }
    }
    cout << ans << '\n';
}

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
//    freopen("test_input.txt", "r", stdin);
    int t = 1;
    while(t--){
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 25 ms 344 KB Output is correct
15 Correct 10 ms 344 KB Output is correct
16 Correct 15 ms 344 KB Output is correct
17 Correct 18 ms 600 KB Output is correct
18 Correct 33 ms 344 KB Output is correct
19 Correct 24 ms 344 KB Output is correct
20 Correct 13 ms 456 KB Output is correct
21 Correct 6 ms 344 KB Output is correct
22 Correct 7 ms 344 KB Output is correct
23 Correct 5 ms 344 KB Output is correct
24 Correct 26 ms 344 KB Output is correct
25 Correct 26 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 25 ms 344 KB Output is correct
15 Correct 10 ms 344 KB Output is correct
16 Correct 15 ms 344 KB Output is correct
17 Correct 18 ms 600 KB Output is correct
18 Correct 33 ms 344 KB Output is correct
19 Correct 24 ms 344 KB Output is correct
20 Correct 13 ms 456 KB Output is correct
21 Correct 6 ms 344 KB Output is correct
22 Correct 7 ms 344 KB Output is correct
23 Correct 5 ms 344 KB Output is correct
24 Correct 26 ms 344 KB Output is correct
25 Correct 26 ms 344 KB Output is correct
26 Execution timed out 2011 ms 600 KB Time limit exceeded
27 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 2031 ms 2896 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 2031 ms 2896 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 2031 ms 2896 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 2031 ms 2896 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 25 ms 344 KB Output is correct
15 Correct 10 ms 344 KB Output is correct
16 Correct 15 ms 344 KB Output is correct
17 Correct 18 ms 600 KB Output is correct
18 Correct 33 ms 344 KB Output is correct
19 Correct 24 ms 344 KB Output is correct
20 Correct 13 ms 456 KB Output is correct
21 Correct 6 ms 344 KB Output is correct
22 Correct 7 ms 344 KB Output is correct
23 Correct 5 ms 344 KB Output is correct
24 Correct 26 ms 344 KB Output is correct
25 Correct 26 ms 344 KB Output is correct
26 Execution timed out 2011 ms 600 KB Time limit exceeded
27 Halted 0 ms 0 KB -