Submission #604482

#TimeUsernameProblemLanguageResultExecution timeMemory
604482ogibogi2004Finding Routers (IOI20_routers)C++14
73.33 / 100
2 ms340 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; vector<int> find_routers(int l, int n, int q) { vector<int>r; r.push_back(0); for(int j=1;j<n;j++) { int last=r.back(); int low=(last+2)/2,high=(l-l%2)/2; int mid=(low+high)/2,ans; while(low<=high) { mid=(low+high)/2; if(use_detector((mid*2+last)/2)==j-1) { ans=mid*2; low=mid+1; } else high=mid-1; } r.push_back(ans); } //for(int i=0;i<r.size();i++)cout<<r[i]<<" "; //cout<<endl; return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...