# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1048102 | wood | Mechanical Doll (IOI18_doll) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void create_circuit(int M, std::vector<int> A) {
int N = A.size();
vector<int> res(M+1,-1), x, y;
res[0] = A[0]
for(int i = 1; i<4; i++){
x.pb(-2*i-1);
y.pb(-2*i-2);
}
vector<int> list = {1,9,5,13,3,11,7,15,2,10,6,14,4,12,8,16};
for(int i = 0; i<15; i++){
if(i&1) y.pb(A[list[i]]-1);
else x.pb(A[list[i]-1]);
}
y.pb(0);
answer(res,x,y);
}