Submission #418360

#TimeUsernameProblemLanguageResultExecution timeMemory
418360jacquesamselMechanical Doll (IOI18_doll)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void answer(std::vector<int> C, std::vector<int> X, std::vector<int> Y); void create_circuit(int M, vector<int> A) { vector<int> moves; moves.assign(M, 0); int last = 0; int m = 0; for (int i = 0; i < A.size(); i++) { moves[last] = A[i]; m = max(m, A[i]); last = A[i]; allnumbers.erase(A[i]); } moves[last] = 0; answer(A, {}, {}); }

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:11:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int i = 0; i < A.size(); i++) {
      |                     ~~^~~~~~~~~~
doll.cpp:15:9: error: 'allnumbers' was not declared in this scope
   15 |         allnumbers.erase(A[i]);
      |         ^~~~~~~~~~