제출 #292513

#제출 시각아이디문제언어결과실행 시간메모리
292513theStaticMind자동 인형 (IOI18_doll)C++14
6 / 100
96 ms32204 KiB
#include<bits/stdc++.h> #define sz(x) ((int) (x).size()) #define all(x) (x).begin(), (x).end() #define pb push_back using namespace std; #include "doll.h" int n; vector<int> adj[1000000]; vector<int> C, X, Y; void generate(int x){ if(sz(adj[x]) == 0) C[x] = 0; else if(sz(adj[x]) == 1) C[x] = adj[x][0]; else if(sz(adj[x]) == 2){ X.pb(adj[x][0]); Y.pb(adj[x][1]); C[x] = -sz(X); } } void create_circuit(int M, std::vector<int> A) { n = A.size(); C = vector<int>(M + 1, 0); for(int i = 0; i < n - 1; i++){ adj[A[i]].pb(A[i + 1]); } adj[0].pb(A[0]); adj[A[n - 1]].pb(0); for(int i = 0; i <= M; i++) generate(i); 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...