Submission #198143

#TimeUsernameProblemLanguageResultExecution timeMemory
198143SuperJavaMechanical Doll (IOI18_doll)C++17
2 / 100
78 ms10340 KiB
#include "doll.h" #include <vector> #define sz(A) int(size(A)) using namespace std; vector<int> adj[200005]; void create_circuit(int M, vector<int> A) { for(int i = 0; i < sz(A)-1; i++){ adj[A[i]].push_back(A[i+1]); } vector<int> C(M+1); C[0] = A[0]; vector<int> X,Y; for(int i = 1; i <= M; i++){ if(sz(adj[i]) == 0) continue; if(sz(adj[i]) == 1){ C[i] = adj[i][0]; continue; } if(sz(adj[i]) == 2){ C[i] = -(sz(X)+1); X.push_back(adj[i][0]); Y.push_back(adj[i][1]); continue; } } 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...