# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1221137 | FaresSTH | Cave (IOI13_cave) | C++20 | 0 ms | 0 KiB |
#include"bits/stdc++.h"
#include"cave.h"
using namespace std;
using ll=long long;
#define S second
#define F first
void exploreCave(int n){
bool s[n]={},v[n]={};
int d[n]={};
for(int i=0;i<n;i++){
int in=tryCombination(s);
int l=0,r=n-1;
while(l<r){
int m=(l+r)/2;
for(int j=l;j<=m;j++)if(!vis[j])s[j]=!s[j];
int cur=tryCombination(s);
for(int j=l;j<m;j++)if(!vis[j])s[j]=!s[j];
if(in!=cur)r=m;
else l=m+1;
}
if(in==0)s[l]=!s[l];
d[i]=l;
v[l]=1;
}
answer(s,d);
}