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<bits/stdc++.h>
#include "doll.h"
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,f[200009],pi;
vector <int> C,X,Y,v[200009];
void create_circuit(int MM, std::vector<int> AA) {
a=AA.size();b=MM;
for(i=1; i<=a; i++) f[i]=AA[i-1];
C.resize(b+1);pi=0;
for(i=1; i<a; i++){
v[f[i]].push_back(f[i+1]);
}
v[f[a]].push_back(0);
C[0]=f[1];
for(i=1; i<=b; i++){
if(v[i].size()==0) continue;
if(v[i].size()==1){
C[i]=v[i][0];
continue;
}
pi--;
C[i]=pi;
X.push_back(v[i][0]);
Y.push_back(v[i][1]);
}
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... |