제출 #585598

#제출 시각아이디문제언어결과실행 시간메모리
585598LIF자동 인형 (IOI18_doll)C++14
0 / 100
10 ms5036 KiB
#include "doll.h" #include<bits/stdc++.h> using namespace std; void create_circuit(int M, std::vector<int> A) { int N = A.size(); std::vector<int> x,y; std::vector<int> c(M+1); int n = N; vector<int> node[50005]; int tt = A[0]; c[0] = tt; node[0].push_back(tt); for(int i=0; i<=n-2; i++) { int xx = A[i]; int kk = A[i+1]; node[xx].push_back(kk); } node[A[n-1]].push_back(0); int fir=0; for(int i=1;i<=M;i++) { int sum = node[i].size(); if(sum==1) { c[i] = node[i][0]; } if(sum==2) { fir++; c[i] = 0-fir; x.push_back(node[i][0]); y.push_back(node[i][1]); } } 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...