Submission #1230109

#TimeUsernameProblemLanguageResultExecution timeMemory
1230109neisennFinding Routers (IOI20_routers)C++20
39 / 100
1 ms328 KiB
#include <iostream> #include <vector> #include "routers.h" using namespace std; #define pb push_back #define ppb pop_back #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> pii; const char nl = '\n'; std::vector<int> find_routers(int l, int n, int q) { cin >> l >> n >> q; vector<int> p(n,0); p[0] = 0; for (int i = 1; i < n; i++){ int lo = p[i-1]+1; int hi = l; int ans = -1; while (lo <= hi){ int mid = (lo+hi)/2; int ret = use_detector(mid); if (ret >= i){ hi = mid-1; } else { ans = mid; lo = mid+1; } } if (ans == -1) p[i] = p[i-1]+1; else p[i] = 2*ans+p[i-1]; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...