Submission #421531

#TimeUsernameProblemLanguageResultExecution timeMemory
421531marcipan5000Mechanical Doll (IOI18_doll)C++14
0 / 100
15 ms5860 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> t[100001]; for (int i=0;i<n-1;i++) { t[a[i]].push_back(a[i+1]); } t[a[n-1]].push_back(0); t[0].push_back(a[0]); vector<int> x,y,c; int p=-1; for (int i=0;i<=m;i++) { if (t[i].size()==1) { c.push_back(t[i][0]); } if (t[i].size()==2) { c.push_back(p); x.push_back(t[i][0]); y.push_back(t[i][1]); p--; } if (t[i].size()==3) { c.push_back(p); x.push_back(p-1); y.push_back(p-2); x.push_back(t[i][0]); y.push_back(t[i][1]); x.push_back(p); y.push_back(t[i][2]); p=p-3; } if (t[i].size()==4) { c.push_back(p); x.push_back(p-1); y.push_back(p-2); x.push_back(t[i][0]); y.push_back(t[i][2]); x.push_back(t[i][1]); y.push_back(t[i][3]); p=p-3; } } 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...