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;
const int MAX_DEC=100*1000+1;
int nbDec,longChaine,date;
vector<int> chaine,direc,prem,deuz;
vector<int> adja[MAX_DEC];
void create_circuit(int M,vector<int> A) {
nbDec=M;
longChaine=A.size();
chaine=A;
chaine.push_back(0);
adja[0].push_back(chaine[0]);
for (int i=0;i<longChaine;i++) {
adja[chaine[i]].push_back(chaine[i+1]);
}
date=-1;
for (int i=0;i<=nbDec;i++) {
if (adja[i].size()==0) {
direc.push_back(0);
}
else if (adja[i].size()==1) {
direc.push_back(adja[i][0]);
}
else if (adja[i].size()==2) {
direc.push_back(date);
prem.push_back(adja[i][0]);
deuz.push_back(adja[i][1]);
date--;
}
else if (adja[i].size()==3) {
direc.push_back(date);
prem.push_back(date-1);
deuz.push_back(date-2);
prem.push_back(adja[i][0]);
deuz.push_back(date);
prem.push_back(adja[i][1]);
deuz.push_back(adja[i][2]);
date-=3;
}
else {
direc.push_back(date);
prem.push_back(date-1);
deuz.push_back(date-2);
prem.push_back(adja[i][0]);
deuz.push_back(adja[i][2]);
prem.push_back(adja[i][1]);
deuz.push_back(adja[i][3]);
date-=2;
}
}
/*for (int i=0;i<direc.size();i++) {
cout<<direc[i]<<" ";
}
cout<<endl;
for (int i=0;i<prem.size();i++) {
cout<<prem[i]<<" "<<deuz[i]<<endl;
}*/
answer(direc,prem,deuz);
}
# | 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... |