Submission #960277

# Submission time Handle Problem Language Result Execution time Memory
960277 2024-04-10T06:53:52 Z SoSmolSten Cave (IOI13_cave) C++17
0 / 100
24 ms 516 KB
#include "cave.h"
const int SZ = 5010;
int s[SZ];
int d[SZ];
void exploreCave(int N) {
	for(int i = 0; i < N; ++i){
		s[i] = 1;
	}
	int v = tryCombination(s);
	while(v != -1){
		int l = 0, r = N - 1;
		while(l <= r){
			if(l == r) break;
			int mid = (l + r) >> 1;
			for(int i = l; i <= mid; ++i){
				s[i] ^= 1;
			}
			int t = tryCombination(s);
			for(int i = l; i <= mid; ++i){
				s[i] ^= 1;
			}
			if(t > v) r = mid - 1;
			else l = mid + 1;
		}
		s[l] ^= 1;
		v = tryCombination(s);
	}	for(int i = 0; i < N; ++i){
		s[i] ^= 1;
		d[i] = tryCombination(s);
		s[i] ^= 1;
	}
	answer(s, d);
}
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 348 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 516 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB too much calls on tryCombination()
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB too much calls on tryCombination()
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 348 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -