Submission #981443

# Submission time Handle Problem Language Result Execution time Memory
981443 2024-05-13T08:22:51 Z batsukh2006 Cave (IOI13_cave) C++17
0 / 100
1 ms 604 KB
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
void exploreCave(int N){
	int pos[N],ans[N];
	vector<bool> vis(N);
	memset(pos,0,sizeof(pos));
    for(int i=0; i<N; i++){
    	int tmp=0,p=0;
    	if(tryCombination(pos)==i) tmp=1;
		int l=0,r=N-1;
		while(l<=r){
			int m=l+(r-l)/2;
			for(int z=0; z<=m; z++){
				if(!vis[z]) pos[z]^=1;
			}
			if(tmp){
				if(tryCombination(pos)==i) l=m+1,p=pos[m]^1;
				else r=m-1,tmp^=1,p=pos[m];
			}else{
				if(tryCombination(pos)==i) r=m-1,p=pos[m]^1,tmp^=1;
				else l=m+1,p=pos[m];
			}
		}
		l--;
		vis[l]=1;
		ans[l]=i;
		pos[l]=p;
    }
    answer(pos,ans);
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -