Submission #921520

#TimeUsernameProblemLanguageResultExecution timeMemory
921520vjudge1Team Contest (JOI22_team)C++17
8 / 100
42 ms4944 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; #define all(a) (a).begin(), (a).end() #define ff first #define ss second const int mod = 1e9 + 7; const long long infl = 1e18 + 1; const int inf = 1e9 + 1; template<typename T> int len(T &a){ return a.size(); } struct type{ int a, b, c; }; void solve(){ int n; cin >> n; vector<type> v(n); for(auto &[a, b, c] : v) cin >> a >> b >> c; sort(all(v), [&](type a, type b){ return a.a < b.a; }); auto brute = [&](){ assert(n <= 300); int res = -1; for(int i = 0; i < n; i ++){ for(int j = 0; j < n; j ++){ for(int k = 0; k < n; k ++){ if(v[i].a > v[j].a && v[i].a > v[k].a && v[j].b > v[i].b && v[j].b > v[k].b && v[k].c > v[i].c && v[k].c > v[j].c){ res = max(res, v[i].a + v[j].b + v[k].c); } } } } return res; }; cout << brute(); } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int testcases = 1; // cin >> testcases; while(testcases --){ solve(); if(testcases){ cout << '\n'; } #ifdef LOCAL else cout << '\n'; cout << "______________" << endl; #endif } }
#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...