Submission #483580

#TimeUsernameProblemLanguageResultExecution timeMemory
483580ponytailMechanical Doll (IOI18_doll)C++17
Compilation error
0 ms0 KiB
#include "doll.h" #include <vector> #include <cstdio> #include <cstdlib> #include <bits/stdc++.h> using namespace std; void create_circuit(int M, std::vector<int> A) { vector<int> C(M+1); vector<int> empty; C[0] = A[0]; for(int i=0; i<N-1; i++) { C[A[i]] = A[i+1]; } C[A[N-1]] = 0; answer(C, empty, empty); }

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:12:20: error: 'N' was not declared in this scope
   12 |     for(int i=0; i<N-1; i++) {
      |                    ^
doll.cpp:15:9: error: 'N' was not declared in this scope
   15 |     C[A[N-1]] = 0;
      |         ^