Submission #985337

# Submission time Handle Problem Language Result Execution time Memory
985337 2024-05-17T15:49:17 Z user736482 Cave (IOI13_cave) C++17
0 / 100
16 ms 348 KB
#include<bits/stdc++.h>
#include<cave.h>
using namespace std;
int match[5002],sent[5002];
bool openstate,fixed_[5002];
int ak;
void change(int a, int b, int c){
    for(int i=a;i<=b;i++){
        if(!fixed_[i])
            sent[i]= c;
    }
}

void exploreCave(int n){
    for(int i=0;i<n;i++){
        change(0,4999,1);
        ak = tryCombination(sent);
        if(ak!=i){
            openstate=1;
        }
        else{
            openstate=0;
        }
        int pocz=0;
        int kon=0;
        while(pocz<kon){
            int sr=(pocz+kon)/2;
            change(pocz,sr,openstate);
            change(sr+1,kon,!openstate);
            ak=tryCombination(sent);
            if(ak > i || ak==-1)
            {
                kon=sr;
            }
            else{
                pocz=sr+1;
            }
        }
        sent[pocz]=openstate;
        match[i]=pocz;
        fixed_[pocz]=1;
    }
    answer(sent,match);
}
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -