제출 #298723

#제출 시각아이디문제언어결과실행 시간메모리
298723inbarin자동 인형 (IOI18_doll)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> using namespace std; #define fort(s,e) for(int i = s; i < e; i++) void create_circuit(int m, vector<int> a){ int asc = a.size(); a.push_back(0); vector<int>trig(m+1); vector<int>x,y; int cs = 0; fort(0,m+1){ trig[i] = -1; } int asp = 1; vector<int>dec; int jl = 0; while(asc){ jl++; asp*=2; dec.push_back(asc%2); asc/=2; } asc = a.size(); for(int i = 0; i < asp/2-1;i++){ x.push_back(-(i+1)*2); y.push_back(-(i+1)*2-1); } for(int i = asp/2 - 1;i < asp - 1;i++){ x.push_back(-1); y.push_back(-1); } int xl = asp / 2 - asc / 2; int yl = asp / 2 - asc / 2 - asc % 2; int l = 0; for(int i = 0; i < asp;i++){ int ci = i; int rev = 0; int j = 0; while(j < jl){ rev *= 2; rev += ci % 2; ci/=2; j++; } if(rev % 2){ if(asp/2 - 1 - rev/2 < xl){ continue; } l++; x[asp - 2 - rev/2] = a[(int)a.size()-l]; } else { if(asp/2 - 1 - rev/2 < yl){ continue; } l++; y[asp - 2 - rev/2] = a[(int)a.size()-l]; } if(l == (int)a.size()){ break; } } answer(trig,x,y); return; }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:63:2: error: 'answer' was not declared in this scope
   63 |  answer(trig,x,y);
      |  ^~~~~~
doll.cpp:11:6: warning: unused variable 'cs' [-Wunused-variable]
   11 |  int cs = 0;
      |      ^~