제출 #560692

#제출 시각아이디문제언어결과실행 시간메모리
560692tfg자동 인형 (IOI18_doll)C++17
컴파일 에러
0 ms0 KiB
#include "doll.h" std::vector<int> X, Y; int solve(std::vector<int> A) { int id = (int) X.size(); X.push_back(-id-1), Y.push_back(-id-1); int n = (int) A.size(); if(n == 1) { Y[id] = A[0]; } else if(n == 2) { X[id] = A[0]; Y[id] = A[1]; } else { if(n % 2) { n++; A.insert(A.end() - 1, -id-1); } std::vector<int> parts[2]; for(int i = 0; i < n; i++) { parts[i%2].push_back(A[i]); } X[id] = solve(parts[0]); Y[id] = solve(parts[1]); } return -id-1; } void create_circuit(int M, std::vector<int> A) { int N = A.size(); std::vector<int> C(M + 1, -1); C[0] = A[0]; A.erase(A.begin()); solve(A, 0); answer(C, X, Y); }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:34:13: error: too many arguments to function 'int solve(std::vector<int>)'
   34 |   solve(A, 0);
      |             ^
doll.cpp:5:5: note: declared here
    5 | int solve(std::vector<int> A) {
      |     ^~~~~
doll.cpp:30:7: warning: unused variable 'N' [-Wunused-variable]
   30 |   int N = A.size();
      |       ^