Submission #1141531

#TimeUsernameProblemLanguageResultExecution timeMemory
1141531vikofazMechanical Doll (IOI18_doll)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h #include "doll.h" using namespace std; #define pb push_back void create_circuit(int M, std::vector<int> A) { int N = A.size(); vector<int> adj[M]; for(int i = 0; i<N; i++){ if(i<N-1) adj[A[i]-1].pb(A[i+1]); else adj[A[i]-1].pb(0); } vector<int> res(M+1), x, y; int cur = 0; res[0] = A[0]; for(int i = 0; i<M; i++){ if(adj[i].size()==1) res[i+1] = adj[i][0]; if(adj[i].size()==2){ cur++; res[i+1] = -cur; x.pb(adj[i][0]); y.pb(adj[i][1]); } if(adj[i].size()>2){ cur++; res[i+1] = -cur; cur++; x.pb(-cur); cur++; y.pb(-cur); x.pb(adj[i][0]); if(adj[i].size()==3) { y.pb(-cur+2); x.pb(adj[i][1]); y.pb(adj[i][2]); } else{ x.pb(adj[i][1]); y.pb(adj[i][2]); y.pb(adj[i][3]); } } } answer(res,x,y); }

Compilation message (stderr)

doll.cpp:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^