제출 #207772

#제출 시각아이디문제언어결과실행 시간메모리
207772a_player동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> #define try tryCombination using namespace std; const int MAXN = 5e3+5; int S[MAXN]; int D[MAXN]; int st[MAXN]; int N; vector<int> u; bool check(int t,bool open){ for(int j=0;j<=t;j++)st[j]=open; for(int j=t+1;j<N;j++)st[j]=!open; for(int x:u)st[x]=S[x]; int h=try(st); return h==i; } void exploreCave(int N){ ::N=N; for(int i=0;i<N;i++){ int t=try(S); bool open=false; if(t==i)open=true; int l=-1,r=N-1; while(r-l>1){ int m=(l+r)/2; if(check(m,open))l=m; else r=m; } D[l+1]=i; S[l+1]=open; u.push_back(l+1); } answer(S,D); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'bool check(int, bool)':
cave.cpp:18:21: error: 'i' was not declared in this scope
           return h==i;
                     ^