Submission #373676

#TimeUsernameProblemLanguageResultExecution timeMemory
373676Aryan_RainaLost in the cycle (IOI19_cycle)C++14
33 / 100
1 ms364 KiB
#include "cycle.h"
#include<bits/stdc++.h>
 
using namespace std;
 
void escape(int n) {
	int j = log2(n);
	bool b = jump(1<<j);
	while (true) {
		// cout<<j<<" "<<b<<endl;
		if (b) {
			j--;
			if (j < 0) return;
			b = jump(1<<j);
		} else {
			j--;
			if (j < 0) {
				b = jump(n - (1<<(j+1)));
				return;
			}
			b = jump(n - (1<<(j+1)) + (1<<j));
		}
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...