Submission #545265

# Submission time Handle Problem Language Result Execution time Memory
545265 2022-04-04T06:34:07 Z leaked Team Contest (JOI22_team) C++14
8 / 100
2000 ms 10836 KB
#include <bits/stdc++.h>

#define f first
#define s second
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pb push_back
#define sz(x) (int)(x).size()
#define pw(x) (1LL<<(x))
#define fast_resp ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef pair<int,ll> pil;
template<class T> bool umin(T &a,const T &b){return (a>b?a=b,1:0);}
template<class T> bool umax(T &a,const T &b){return (a<b?a=b,1:0);}
const ll inf=1e18;
signed main(){
    fast_resp;
    int n;
    cin>>n;
    vec<vec<int>>a(n,vec<int>(3));
//    vec<int>mx(3);
    vec<vec<int>> kekw(3);
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
            cin>>a[i][j],kekw[j].pb(a[i][j]);
        }
    }
    for(int j=0;j<3;j++)
        sort(all(kekw[j]));
//    auto check=[&](int x,int j){
//        if(sz(kekw[]))
//    };
    vec<int>ans;
    int mxt=-1;
//    for(i)
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            for(int k=0;k<n;k++){
                if(a[i][0]>max(a[j][0],a[k][0]) &&
                   a[j][1]>max(a[i][1],a[k][1]) &&
                   a[k][2]>max(a[i][2],a[j][2])){
//                    if(mx[0]==a[i][0] || mx[1]==a[i][1] || mx[2]==a[i][2]){
                        umax(mxt,a[i][0]+a[j][1]+a[k][2]);
//                        ans={i,j,k};
//                    }
                }
            }
        }
    }
    cout<<mxt;
//    if(mxt==-1){
//        cout<<-1;
//        return 0;
//    }
    return 0;
}
/*

*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 55 ms 340 KB Output is correct
15 Correct 24 ms 212 KB Output is correct
16 Correct 35 ms 340 KB Output is correct
17 Correct 42 ms 340 KB Output is correct
18 Correct 42 ms 340 KB Output is correct
19 Correct 52 ms 340 KB Output is correct
20 Correct 39 ms 340 KB Output is correct
21 Correct 27 ms 340 KB Output is correct
22 Correct 31 ms 340 KB Output is correct
23 Correct 22 ms 348 KB Output is correct
24 Correct 26 ms 340 KB Output is correct
25 Correct 27 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 55 ms 340 KB Output is correct
15 Correct 24 ms 212 KB Output is correct
16 Correct 35 ms 340 KB Output is correct
17 Correct 42 ms 340 KB Output is correct
18 Correct 42 ms 340 KB Output is correct
19 Correct 52 ms 340 KB Output is correct
20 Correct 39 ms 340 KB Output is correct
21 Correct 27 ms 340 KB Output is correct
22 Correct 31 ms 340 KB Output is correct
23 Correct 22 ms 348 KB Output is correct
24 Correct 26 ms 340 KB Output is correct
25 Correct 27 ms 340 KB Output is correct
26 Execution timed out 2088 ms 596 KB Time limit exceeded
27 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Execution timed out 2091 ms 10836 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Execution timed out 2091 ms 10836 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Execution timed out 2091 ms 10836 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Execution timed out 2091 ms 10836 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 55 ms 340 KB Output is correct
15 Correct 24 ms 212 KB Output is correct
16 Correct 35 ms 340 KB Output is correct
17 Correct 42 ms 340 KB Output is correct
18 Correct 42 ms 340 KB Output is correct
19 Correct 52 ms 340 KB Output is correct
20 Correct 39 ms 340 KB Output is correct
21 Correct 27 ms 340 KB Output is correct
22 Correct 31 ms 340 KB Output is correct
23 Correct 22 ms 348 KB Output is correct
24 Correct 26 ms 340 KB Output is correct
25 Correct 27 ms 340 KB Output is correct
26 Execution timed out 2088 ms 596 KB Time limit exceeded
27 Halted 0 ms 0 KB -