# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1231884 | badge881 | Cave (IOI13_cave) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
void subtask1(int);
void subtask2(int);
void subtask3(int);
void exploreCave(int N)
{
subtask1(N);
}
void subtask1(int N)
{
vector<int> D(N);
iota(D.begin(), D.end(), 1);
vector<int> S(N, 0);
int knowAt = 0;
while (knowAt < N)
{
S[knowAt] ^= 1;
int res = tryCombination(S);
if (res == -1)
answer(S, D);
knowAt = res;
}
}
void subtask2(int N)
{
vector<int> S(N, 0);
vector<int> D(N);
for (int switchId = 0; switchId < N; switchId++)
{
S[switchId] = 1;
int res = tryCombination(S);
D[switchId] = res;
S[switchId] = 0;
}
answer(S, D);
}
void subtask3(int N)
{
// pass
}