Submission #1308683

#TimeUsernameProblemLanguageResultExecution timeMemory
1308683avahwLost in the cycle (IOI19_cycle)C++20
11 / 100
1 ms408 KiB
#include "cycle.h"
#include <bits/stdc++.h>
using namespace std;

void escape(int n) {
	if(n == 2){
		jump(1);
	}
	else{
		int can_start = (n / 2);
		int can_end = (n - 1);
		if(n % 2 == 0) can_start++;
		int escape_steps = 0;
		bool reach = jump(1);
		if(reach){
			// go forwards until we reach 1
			while(true){
				bool able = jump(1);
				if(!able){
					escape_steps = n - 1;
					break;
				}
			}

		}
		if(!reach){
			while(true){
				bool able = jump(1);
				if(able){
					escape_steps = n / 2;
					break;
				}
			}
		}
		jump(escape_steps);
		}

	
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...