Submission #624282

# Submission time Handle Problem Language Result Execution time Memory
624282 2022-08-07T16:23:16 Z Dan4Life Mechanical Doll (IOI18_doll) C++17
Compilation error
0 ms 0 KB
#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

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;
      |       ^