Submission #957780

#TimeUsernameProblemLanguageResultExecution timeMemory
957780hirayuu_ojLost in the cycle (IOI19_cycle)C++17
100 / 100
1 ms596 KiB
#include "cycle.h" #include<bits/stdc++.h> using namespace std; using ll=long long; void escape(int n) { while(true){ if(jump((n/2+1)%n))break; } ll jmp=1; while(jmp*2<=(n-(n/2+1))%n-1){ jmp*=2; } ll nx=jmp; if(!jump((n-(n/2+1))%n)){ nx+=n-(n-(n/2+1))%n; } while(jmp){ if(jump(nx%n)){ nx=jmp/2; } else{ nx=((jmp/2+n-jmp)%n); } jmp/=2; } if(nx!=0){ jump(nx); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...