제출 #650804

#제출 시각아이디문제언어결과실행 시간메모리
650804Litusiano동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; map<int,int> used; #define MAX_N 5000 int v[MAX_N]; void convert(int idx, int val){ for(int i = 0; i<= idx; i++){ if(used[i]) continue; v[i] = val; } } void exploreCave(int z) { /* ... */ //int v[N]; for(int i = 0; i<N; i++){ v[i] = 0; } int s[N]; // Busco combinacio correcte for(int i = 0; i<N; i++){ bool ok = 0; int l = -1; int r = N-1; int val = 0; convert(N-1,0); if(i == 2){ /*cout<<"V "; for(int i = 0; i<N; i++) cout<<v[i]<<" "; cout<<endl;*/ } if(tryCombination(v) == i) val = 1; convert(N-1,val^1); while(r > l+1){ int m = (l+r)/2; convert(m,val); // si s'ha obert, int x = tryCombination(v); if (x == -1){ ok = 1; break; } if(x == i){ //tancat l = m; } else r = m; convert(m,val^1); } if(ok) break; //cout<<i<<" "<<l<<" "<<r<<" "<<val<<endl; used[r] = 1; v[r] = val; } for(int i = 0; i<N; i++){ v[i] ^= 1; s[i] = tryCombination(v); v[i] ^= 1; } answer(v,s); //for(int i = 0; i<N; i++) cout<<v[i]<<" "; cout<<endl; //for(int i = 0; i<N; i++) cout<<s[i]<<" "; cout<<endl; return; }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:20: error: 'N' was not declared in this scope
   19 |   for(int i = 0; i<N; i++){
      |                    ^
cave.cpp:22:9: error: 'N' was not declared in this scope
   22 |   int s[N];
      |         ^
cave.cpp:59:7: error: 's' was not declared in this scope
   59 |       s[i] = tryCombination(v);
      |       ^
cave.cpp:62:12: error: 's' was not declared in this scope
   62 |   answer(v,s);
      |            ^