제출 #34796

#제출 시각아이디문제언어결과실행 시간메모리
34796SYury동굴 (IOI13_cave)C++11
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double dbl; typedef pair<int, int> pii; #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define sqr(x) (x)*(x) #define F(i, l, r) for(int i = (l); i < (r); i++) #define DF(i, l, r) for(int i = (l); i > (r); i--) #define I(x, a) for(auto x : (a)) #define mp make_pair #define X first #define Y second #define clean(x) memset((x), 0, sizeof(x)) #define ret return #define cont continue #define brk break #define ins insert #define all(x) (x).begin(),(x).end() #define sz(x) (int)(x).size() #define sync ios_base::sync_with_stdio(false);cin.tie(0) #define pb push_back #define fin(x) freopen(x, "r", stdin) #define fout(x) freopen(x, "w", stdout) #define y1 fjfg const int maxn = 5e3 + 3; int state[maxn], known[maxn]; int what[maxn]; void exploreCave(int n){ F(i, 0, n)state[i] = 0; F(i, 0, n)known[i] = -1; while(true){ int k = tryCombination(state); bool fa = true; F(i, 0, n){ if(known[i] != -1)cont; fa = false; state[i] = 1 - state[i]; int j = tryCombination(state); state[i] = 1 - state[i]; if(j < k){known[i] = state[i]; what[i] = j;} if(j > k){known[i] = 1 - state[i]; state[i] = 1 - state[i]; what[i] = j;} } if(fa)brk; } answer(known, what); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:41:11: error: 'tryCombination' was not declared in this scope
   int k = tryCombination(state);
           ^~~~~~~~~~~~~~
cave.cpp:54:2: error: 'answer' was not declared in this scope
  answer(known, what);
  ^~~~~~
cave.cpp:54:2: note: suggested alternative: 'assert'
  answer(known, what);
  ^~~~~~
  assert