제출 #1221138

#제출 시각아이디문제언어결과실행 시간메모리
1221138FaresSTH동굴 (IOI13_cave)C++20
컴파일 에러
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); }

컴파일 시 표준 에러 (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];
      |                                              ^~~