# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
716707 | aykhn | Cave (IOI13_cave) | C++14 | 242 ms | 584 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
typedef long long ll;
#define OPT ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define endl "\n"
#define all(v) v.begin(), v.end()
#define mpr make_pair
#define pb push_back
#define ts to_string
#define fi first
#define se second
#define inf 0x3F3F3F3F
#define bpc __builtin_popcount
#define print(v) for(int i = 0; i < v.size(); i++) cout << v[i] << " "; cout<<endl;
void exploreCave(int N)
{
int open[N];
int ans[N];
int used[N];
for (int i = 0; i < N; i++)
{
open[i] = 0;
used[i] = -1;
}
for (int i = 0; i < N; i++)
{
int l = 0;
int r = N - 1;
int pans = tryCombination(open);
while (l < r)
{
int mid = (l + r) >> 1;
for (int j = l; j <= mid; j++)
{
if (used[j] != -1) continue;
open[j] = 1 - open[j];
}
int ans = tryCombination(open);
for (int j = l; j <= mid; j++)
{
if (used[j] != -1) continue;
open[j] = 1 - open[j];
}
if (pans == -1)
{
if (ans != i) l = mid + 1;
else r = mid;
}
else if (pans == i)
{
if (ans != pans || ans == -1) r = mid;
else l = mid + 1;
}
else
{
if (ans == i) r = mid;
else l = mid + 1;
}
}
used[l] = i;
if (pans == i) open[l] = 1;
else open[l] = 0;
}
answer(open, used);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |