Submission #421566

#TimeUsernameProblemLanguageResultExecution timeMemory
421566marcipan5000Mechanical Doll (IOI18_doll)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void create_circuit (int M, std::vector<int> A) { int n=A.size(); vector<int> t[100001]; for (int i=0;i<n-1;i++) { t[A[i]].push_back(A[i+1]); } t[A[n-1]].push_back(0); t[0].push_back(A[0]); vector<int> x,y,c; int p=-1; for (int i=0;i<=M;i++) { if (t[i].size()==0) { c.push_back(0); } if (t[i].size()==1) { c.push_back(t[i][0]); } if (t[i].size()==2) { c.push_back(p); x.push_back(t[i][0]); y.push_back(t[i][1]); p--; } if (t[i].size()==3) { c.push_back(p); x.push_back(p-1); y.push_back(p-2); x.push_back(t[i][0]); y.push_back(t[i][1]); x.push_back(p); y.push_back(t[i][2]); p=p-3; } if (t[i].size()==4) { c.push_back(p); x.push_back(p-1); y.push_back(p-2); x.push_back(t[i][0]); y.push_back(t[i][2]); x.push_back(t[i][1]); y.push_back(t[i][3]); p=p-3; } } answer(c,x,y); }

Compilation message (stderr)

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