Submission #1221138

#TimeUsernameProblemLanguageResultExecution timeMemory
1221138FaresSTH동굴 (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){
       int 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: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: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];
      |                                              ^~~