Submission #1221137

#TimeUsernameProblemLanguageResultExecution timeMemory
1221137FaresSTH동굴 (IOI13_cave)C++20
Compilation error
0 ms0 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);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:37: error: cannot convert 'bool*' to 'int*'
   11 |               int in=tryCombination(s);
      |                                     ^
      |                                     |
      |                                     bool*
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:15:47: error: 'vis' was not declared in this scope
   15 |                      for(int j=l;j<=m;j++)if(!vis[j])s[j]=!s[j];
      |                                               ^~~
cave.cpp:16:45: error: cannot convert 'bool*' to 'int*'
   16 |                      int cur=tryCombination(s);
      |                                             ^
      |                                             |
      |                                             bool*
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:17:46: error: 'vis' was not declared in this scope
   17 |                      for(int j=l;j<m;j++)if(!vis[j])s[j]=!s[j];
      |                                              ^~~
cave.cpp:25:15: error: cannot convert 'bool*' to 'int*'
   25 |        answer(s,d);
      |               ^
      |               |
      |               bool*
In file included from cave.cpp:2:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~