Submission #433293

#TimeUsernameProblemLanguageResultExecution timeMemory
433293Tiago_MarquesFinding Routers (IOI20_routers)C++17
39 / 100
1 ms332 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; #define pb push_back std::vector<int> find_routers(int l, int n, int q) { int minimo = 1, maximo = l, x, y; while (minimo < maximo - 1) { int med = (minimo + maximo)/2; y = (med + 1)/2; while (2*y <= minimo) y ++; while (2*y-1 >= maximo) y --; x = use_detector(y); if (x == 0) minimo = 2*y; else maximo = 2*y - 1; } vector<int> ans; ans.pb (0); if (minimo%2 == 0) ans.pb (minimo); else ans.pb (maximo); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...