제출 #463665

#제출 시각아이디문제언어결과실행 시간메모리
463665oscar1f자동 인형 (IOI18_doll)C++17
16 / 100
110 ms15428 KiB
#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-=3; } } /*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 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...