제출 #463710

#제출 시각아이디문제언어결과실행 시간메모리
463710oscar1f통행료 (IOI18_highway)C++17
0 / 100
14 ms812 KiB
#include<bits/stdc++.h> #include "highway.h" using namespace std; //#define int long long const int MAX_SOM=90*1000; int nbSom,bas,haut,nbAre,distTotal,petit,grand,mid,rep; vector<int> quest; void find_pair(int N,vector<int> U,vector<int> V,int A,int B) { nbAre=U.size(); nbSom=N; bas=A; haut=B; for (int i=0;i<nbAre;i++) { quest.push_back(0); } distTotal=ask(quest); petit=0; grand=nbSom-distTotal; while(petit!=grand) { mid=(petit+grand)/2; for (int i=petit;i<=mid;i++) { quest[i]=1; } rep=ask(quest); for (int i=petit;i<=mid;i++) { quest[i]=0; } if (rep>distTotal) { grand=mid; } else { petit=mid+1; } } answer(petit,petit+distTotal); }
#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...