Submission #561587

#TimeUsernameProblemLanguageResultExecution timeMemory
561587fatemetmhrTeam Contest (JOI22_team)C++17
8 / 100
2045 ms4344 KiB
// Be name khoda //

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pb     push_back
#define all(x) x.begin(), x.end()
#define fi     first
#define se     second

const int maxn5 = 2e5 + 10;
const int maxnt = 8e5 + 10;
const ll  inf   = 1e18;

int n;

int pos2[maxn5], per1[maxn5], per2[maxn5];
ll bsval2[maxn5], val1[maxn5], val2[maxn5], val3[maxn5];
vector <int> toadd;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> val1[i] >> val2[i] >> val3[i];
    }

    ll ans = -1;
    for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++)
        if(val1[i] > val1[j] && val1[i] > val1[k])
            if(val2[j] > val2[i] && val2[j] > val2[k])
                if(val3[k] > val3[i] && val3[k] > val3[j])
                    ans = max(ans, val1[i] + val2[j] + val3[k]);
    cout << ans << endl;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...