# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1195753 | Nonbangkok | 동굴 (IOI13_cave) | C++17 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "cave.h"
#define coutf(n, m) cout << fixed << setprecision(n) << m
#define forr(i, a, n) for (int i = a; i < n; i++)
#define forl(i, a, n) for (int i = a; i > n; i--)
#define macos ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endll "\n"
#define sp " "
typedef long long ll;
using namespace std;
const int N = 5010;
int k;
int S[N],D[N],test[N];
bool fix[N];
void exploreCave(int n) {
forr(i,0,n){
k = (tryCombination==i);
int l = 0, r = n - 1,m;
while(l<r){
m = (l+r) >> 1;
forr(j,0,n){
if(fix[j])test[i] = S[i];
else if(j<=m)test[i] = 1 - k;
else test[i] = k;
}
if(tryCombination(test)==i)r = m
else l = m + 1;
}
S[l-1] = k;
D[l-1] = i;
fix[l-1] = true;
}
answer(S,D);
}