Submission #601764

#TimeUsernameProblemLanguageResultExecution timeMemory
601764enerelt14Mechanical Doll (IOI18_doll)C++14
10 / 100
1 ms296 KiB
#include "doll.h" #include<bits/stdc++.h> #define pb push_back using namespace std; int x[40], y[40]; vector<int>a; bool is[40]; int tree[100], q; void go(int id, int l, int r){ if(l==r){ if (q==16)tree[id]=-q; else tree[id]=a[q]; return; } else tree[id]=-id; int mid=(l+r)/2; if (!is[id]){ go(id*2, l, mid); x[id]=tree[id*2]; is[id]=1; } else{ go(id*2+1, mid+1, r); y[id]=tree[id*2+1]; is[id]=0; } } void create_circuit(int M, vector<int>A){ a=A; vector<int>c, X, Y; c.pb(a[0]); for (int i=1;i<=M;i++)c.pb(-1); for (int i=1;i<=16;i++){ q=i; go(1, 1, 16); } x[16]=-16; y[16]=0; for (int i=1;i<=16;i++)X.pb(x[i]); for (int i=1;i<=16;i++)Y.pb(y[i]); answer(c, X, Y); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...