Submission #544850

#TimeUsernameProblemLanguageResultExecution timeMemory
544850Ronin13Team Contest (JOI22_team)C++14
100 / 100
126 ms6364 KiB
#include<iostream> #include <math.h> #include <queue> #define ll long long #define f first #define s second #define pii pair<int, int> #define pll pair<ll,ll> #define pb push_back #define epb emplace_back #define ull unsigned ll #pragma optimization("unroll-loops") #pragma optimize("Ofast") #pragma optimize("3") #pragma target("avx2,avx,fma") using namespace std; int main(){ ios_base::sync_with_stdio(false);cin.tie(0); int n; cin >> n; int x[n + 1]; int y[n + 1]; int z[n + 1]; for(int i = 1; i <= n; i++){ cin >> x[i] >> y[i] >> z[i]; } int ans = -1; priority_queue <pii> px, py, pz; for(int i = 1; i <= n; i++){ px.push({x[i], i}); py.push({y[i], i}); pz.push({z[i], i}); } while(!px.empty()){ int i = px.top().s; px.pop(); while(!py.empty()){ int j = py.top().s; if(x[j] >= x[i]){ py.pop(); continue; } if(y[i] >= y[j])break; bool indd = false; while(!pz.empty()){ int k = pz.top().s; if(x[k] >= x[i] || y[k] >= y[j]){pz.pop();continue;} if(z[j] >= z[k]){ indd = true; break; } if(z[i] >= z[k])break; cout << z[k] + x[i] + y[j]; return 0; } if(indd)py.pop(); else break; } } cout << -1; return 0; }

Compilation message (stderr)

team.cpp:13: warning: ignoring '#pragma optimization ' [-Wunknown-pragmas]
   13 | #pragma optimization("unroll-loops")
      | 
team.cpp:14: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
   14 | #pragma optimize("Ofast")
      | 
team.cpp:15: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
   15 | #pragma optimize("3")
      | 
team.cpp:16: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
   16 | #pragma target("avx2,avx,fma")
      | 
team.cpp: In function 'int main()':
team.cpp:31:9: warning: unused variable 'ans' [-Wunused-variable]
   31 |     int ans = -1;
      |         ^~~
#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...