Submission #1090758

#TimeUsernameProblemLanguageResultExecution timeMemory
1090758noyancanturkpopa (BOI18_popa)C++17
100 / 100
67 ms676 KiB
#include<bits/stdc++.h> using namespace std; int query(int a, int b, int c, int d); int solve(int n, int* l, int* r){ for(int i=0;i<n;i++)l[i]=r[i]=-1; vector<int>chain{0}; for(int i=1;i<n;i++){ int last=-1; while(chain.size()){ int res=query(chain.back(),chain.back(),chain.back(),i); if(res==1){ r[chain.back()]=i; break; }else{ last=chain.back(); chain.pop_back(); } } l[i]=last; chain.push_back(i); } return chain[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...