답안 #882333

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
882333 2023-12-03T04:41:22 Z dubabuba 동굴 (IOI13_cave) C++14
0 / 100
1 ms 600 KB
#include "cave.h"
#include <bits/stdc++.h>

const int mxn = 5050;
using namespace std;

void exploreCave(int N) {
	int d[N], id[N];
	for(int i = 0; i < N; i++)
		id[i] = i;

	memset(d, 0, sizeof d);
	auto rev = [&](int l, int r) {
		for(int i = l; i <= r; l++)
			d[i] = 1 - d[i];
	};

	int las = tryCombination(d);
	if(las == -1) answer(d, id);

	while(1) {
		d[las + 1] = 1 - d[las + 1];
		las = tryCombination(d);
		if(las == -1) answer(d, id);
	}

	answer(d, id);
}

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:7: warning: variable 'rev' set but not used [-Wunused-but-set-variable]
   13 |  auto rev = [&](int l, int r) {
      |       ^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 600 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 344 KB Answer is wrong
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB too much calls on tryCombination()
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB too much calls on tryCombination()
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 600 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -