Submission #999296

#TimeUsernameProblemLanguageResultExecution timeMemory
999296UnforgettableplHighway Tolls (IOI18_highway)C++17
6 / 100
73 ms2664 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() long long ask(const std::vector<int> &w); void answer(int s, int t); void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { auto base = ask(vector<int>(N-1)); int left = 0; for(int jump=65536;jump;jump/=2){ if(left+jump>=N)continue; vector<int> w(N-1); for(int i=0;i<left+jump;i++)w[i]=1; if(ask(w)==base)left+=jump; } int right = N-1; for(int jump=65536;jump;jump/=2){ if(right-jump<0)continue; vector<int> w(N-1); for(int i=right-jump;i<N-1;i++)w[i]=1; if(ask(w)==base)right-=jump; } answer(left,right); }
#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...