Submission #624282

#TimeUsernameProblemLanguageResultExecution timeMemory
624282Dan4LifeMechanical Doll (IOI18_doll)C++17
Compilation error
0 ms0 KiB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;

void create_circuit(int M, vector<int> A) {
  int N = A.size();
  vector<int> C(M+1);
  C[0] = A[0];
  for(int i = 0; i < N-1; i++) C[A[i]]=A[i+1];
  C[A[n-1]]=0;
  vector<int> X,Y; answer(C,X,Y); return;
  for (int k = 0; k < N; ++k) {
    X[k] = Y[k] = A[k];
  }
  answer(C, X, Y);
}

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:10:7: error: 'n' was not declared in this scope
   10 |   C[A[n-1]]=0;
      |       ^