Submission #1095877

#TimeUsernameProblemLanguageResultExecution timeMemory
1095877owoovoHighway Tolls (IOI18_highway)C++17
6 / 100
73 ms2208 KiB
#include "highway.h" #include<bits/stdc++.h> #define ll long long #define F first #define S second using namespace std; vector<int>w; void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { int M = U.size(); w.resize(M); for(auto x:w)x=0; ll now=ask(w); int l=0,r=M+1; while(l<r-1){ int m=(l+r)>>1; for(int i=0;i<M;i++)w[i]=0; for(int i=0;i<m;i++){ w[i]=1; } ll ne=ask(w); if(ne!=now){ r=m; }else{ l=m; } } int L=-1,R=M; while(L<R-1){ int m=(L+R)>>1; for(int i=0;i<M;i++)w[i]=0; for(int i=M-1;i>=m;i--){ w[i]=1; } ll ne=ask(w); if(ne!=now){ L=m; }else{ R=m; } } //cout<<l<<" "<<R<<"\n"; answer(l,R); return ; }

Compilation message (stderr)

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:11:12: warning: variable 'x' set but not used [-Wunused-but-set-variable]
   11 |   for(auto x:w)x=0;
      |            ^
#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...