Submission #416652

#TimeUsernameProblemLanguageResultExecution timeMemory
416652wiwihoMechanical Doll (IOI18_doll)C++14
6 / 100
89 ms12444 KiB
#include "doll.h" #include <bits/stdc++.h> #define eb emplace_back #define printv(a, b) { \ for(auto pv : a) b << pv << " "; \ b << "\n"; \ } #define mp make_pair #define F first #define S second #define pob pop_back() #define iter(a) a.begin(), a.end() using namespace std; typedef long long ll; using pll = pair<ll, ll>; using pii = pair<int, int>; void create_circuit(int m, vector<int> a){ int n = a.size(); vector<vector<int>> g(m + 1); int lst = 0; for(int i = 0; i < n; i++){ g[lst].eb(a[i]); lst = a[i]; } g[lst].eb(0); vector<int> c(m + 1); int ts = 0; vector<int> x, y; for(int i = 0; i <= m; i++){ if(g[i].empty()) continue; if(g[i].size() == 1){ c[i] = g[i][0]; continue; } ts++; c[i] = -ts; x.eb(g[i][0]); y.eb(g[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...