제출 #992924

#제출 시각아이디문제언어결과실행 시간메모리
992924vjudge1동굴 (IOI13_cave)C++17
0 / 100
6 ms348 KiB
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
// #define int long long
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
const int NN=1e6+50000;
const int MOD=1e9+7;
const int off=(1<<11);

#define ask(x) tryCombination(x);

void exploreCave(int N){
    int S[N]={},D[N]={};
    for(int i=0;i<N;i++){
        int x=ask(S);
        if(x<=i)x=1;
        else x=0;

        int l=i,r=N-1;
        while(l<=r){
            int md=(l+r)/2;
            for(int j=l;j<=md;j++)S[j]=1;
            for(int j=md+1;j<=r;j++)S[j]=0;
            int cur=ask(S);
            if(x==1){
                if(cur>i){
                    r=md;
                }
                else{
                    l=md+1;
                }
            }
            else{
                if(cur>i){
                    l=md+1;
                }
                else{
                    r=md;
                }
            }
        }
        D[l]=i;
        S[l]=x;
    }
    answer(S,D);

}
// signed main(){
//     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
// }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...