Submission #198144

#TimeUsernameProblemLanguageResultExecution timeMemory
198144SuperJavaMechanical Doll (IOI18_doll)C++17
6 / 100
128 ms13300 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]); } adj[A[sz(A)-1]].push_back(0); 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...