Submission #742824

# Submission time Handle Problem Language Result Execution time Memory
742824 2023-05-17T03:20:26 Z Dulguun Cave (IOI13_cave) C++11
0 / 100
50 ms 384 KB
#include<bits/stdc++.h>
#include "cave.h"

using namespace std;
typedef long long ll;

int cur=0;

void exploreCave(int n){
	int s[n], d[n];
	for(int &i: s) i=0;
	while(cur<n){
		
		int exp, mid, l=0, r=n-1;
		
		while(l<r){
			if(l==r){
				d[l]=cur++;
				break;
			}
			mid = (l+r)/2;
			for(int i=l; i<=mid; s[i++]^=1);
			exp = tryCombination(s);
			if(exp>cur || exp==-1) r=mid;
			else l=mid+1;
			for(int i=l; i<=mid; s[i++]^=1);
		}
	}
	answer(s,d);
}
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 384 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 50 ms 380 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 384 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -