Submission #1308672

#TimeUsernameProblemLanguageResultExecution timeMemory
1308672CyanberryLost in the cycle (IOI19_cycle)C++20
0 / 100
1 ms404 KiB
#include <bits/stdc++.h> using namespace std; #include "cycle.h" int totalRooms = 16; int loc = 0; int uses = 0; // bool jump(int x) { // ++uses; // loc += x; // loc %= totalRooms; // return (totalRooms - loc) % totalRooms <= totalRooms/2; // } void escape(int rooms) { int l = 0, r = rooms, pos = 0; while(r - l > 1) { int m = (r+l)/2; int query = m - pos; query += rooms/2; query %= rooms; pos += query; pos %= rooms; if (jump(query)) { r = m; } else { l = m; } } jump((l - pos + rooms + (l != 0)) % rooms); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...