Submission #230863

#TimeUsernameProblemLanguageResultExecution timeMemory
230863AASG동굴 (IOI13_cave)C++17
Compilation error
0 ms0 KiB

#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
    int n=N;
    int R[n];int P[n];
    int aux1[n],aux2[n];
    for(int i=0;i<n;i++){
        R[i]=1;
        P[i]=0;
    }
    for(int i=0;i<n;i++){
        for(int i=0;i<n;i++)aux2[i]=R[i];
        int p1=0,p2=n;
        int x=tryCombination(aux2);
        while(abs(p1-p2)!=1){
            int p3=(p1+p2)/2;
            for(int i=0;i<n;i++){
                if(P[i]==0){
                    aux2[i]=0;
                }
            }
            int y=tryCombination(aux2);
            if(x>i && y>i){
                p1=p3;
            }else{
            p2=p3-1;
            }
        }
        if(aux2[p2]==1){aux2[p2]=0;}
        else aux2[p2]=1;
        if(tryCombination(aux2)<n+1){
            if(aux2[p2]==1){aux2[p2]=0;}
            else aux2[p2]=1;
            R[p2]=aux2[p2];
            P[p2]=n+1;
        }
    }
    answer(R,P);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:15: error: 'tryCombination' was not declared in this scope
         int x=tryCombination(aux2);
               ^~~~~~~~~~~~~~
cave.cpp:39:5: error: 'answer' was not declared in this scope
     answer(R,P);
     ^~~~~~
cave.cpp:39:5: note: suggested alternative: 'assert'
     answer(R,P);
     ^~~~~~
     assert
cave.cpp:7:9: warning: unused variable 'aux1' [-Wunused-variable]
     int aux1[n],aux2[n];
         ^~~~