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;
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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |