제출 #123024

#제출 시각아이디문제언어결과실행 시간메모리
123024teki자동 인형 (IOI18_doll)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define MS(x,y) memset((x),(y),sizeof((x))) #define mn 1000000 using namespace std; int n,sw,p=1; vector<int> x(1<<20),y(1<<20); bitset <(1<<20)> b; int build(int left, int right) { if (left >= right) return 0; else if (right < p-n) return -1; int ts = sw; sw++; int mid = (left+right)/2; x[ts-1] = build(left, mid); y[ts-1] = build(mid+1, right); return ts; } void pt (int i, int j) { int a; if (b[-i]) a = y[-i-1]; else a = x[-i-1]; b[-i] = !b[-i]; if (a <= 0) a = j; else pt(a,j); } void create_circuit(int m, vector<int> a) { n = (int)a.size(); while (p < n) p*=2; build(0, p-1); for (int i = 1; i<n; i++) pt(-1,a[i]); if (n == 1) pt(-1,-1); pt(-1,0); vector<int> c(m+1, 1); x.resize(sw); y.resize(sw); c[0] = a[0]; answer(c,x,y); } int main() { #if LOCAL_DEBUG fstream cin("in.txt"); #endif ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:59:5: error: 'answer' was not declared in this scope
   59 |     answer(c,x,y);
      |     ^~~~~~