# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
73174 | TuGSGeReL | 동굴 (IOI13_cave) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pub push_back
#define pob pop_back
#define ss second
#define ff first
#define ext exit(0)
using namespace std;
ll i,j,ans[5001],pos[5001],ask[5001],k,l,r;
bool boo[5001];
void exploreCave(int n) {
memset(boo,-1,sizeof boo);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(boo[i]==-1) ask[i]=0;
else ask[i]=ans[i];
}
k=tryCombination(ask);
if(k!=i) ans[i]=ask[i];
else ans[i]=1-ask[i];
l=0,r=n;
while(l+1<r){
ll mid=(l+r)/2;
for(j=0;j<n;j++){
if(j<=mid) ask[i]=ans[i];
else ask[i]=1-ans[i];
}
k=tryCombination(ask);
if(k!=i){
l=mid;
}
else r=mid;
}
pos[i]=l;
}
answer()
}