이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <bitset>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define vi vector<int>
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef short inth;
const int N = 1;
const int M = N + 7;
const int MOD = 1e9 + 7;
const ll INF = 1e16 + 17;
void solveSub1(int n, int sw[], int doors[]) {
for (int i = 0; i < n; ++i) {
int res = tryCombination(sw);
if (res == i)
sw[i] ^= 1;
}
for (int i = 0; i < n; ++i)
doors[i] = i;
}
void solveSub2(int n, int sw[], int doors[]) {
for (int i = 0; i < n; ++i) {
sw[i] = 1;
int res = tryCombination(sw);
doors[i] = res;
sw[i] = 0;
}
}
void exploreCave(int n) {
int sw[n], doors[n];
for (int i = 0; i < n; ++i)
sw[i] = doors[i] = 0;
int res = tryCombination(sw);
if (res == -1)
solveSub2(n, sw, doors);
else
solveSub1(n, sw, doors);
answer(sw, doors);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |