Submission #1211431

#TimeUsernameProblemLanguageResultExecution timeMemory
1211431SpyrosAlivMechanical Doll (IOI18_doll)C++20
0 / 100
21 ms4460 KiB
#include "doll.h" #include <bits/stdc++.h> using namespace std; void create_circuit(int m, vector<int> a) { int n = a.size(); n--; vector<int> conn(m+1); conn[0] = 1; conn[1] = -1; vector<int> x, y; for (int i = 1; i <= n; i++) { if (i == n) { y.push_back(0); } else y.push_back(-(i+1)); if (i == 1) { x.push_back(1); } else x.push_back(-(i-1)); } answer(conn, x, y); /* vector<vector<int>> after(m+1); after[0].push_back(a[0]); for (int i = 0; i < n-1; i++) { after[a[i]].push_back({a[i+1]}); } after[a.back()].push_back(0); for (int i = 0; i <= m; i++) conn[i] = i; vector<int> x, y; int sw = 0; for (int i = 0; i <= m; i++) { int adj = after[i].size(); if (adj == 0) continue; else if (adj == 1) { conn[i] = after[i][0]; continue; } else if (adj == 2) { sw++; x.push_back(after[i][0]); y.push_back(after[i][1]); conn[i] = -sw; } else if (adj == 3) { sw++; x.push_back(-(sw+1)); y.push_back(-(sw+2)); conn[i] = -sw; sw++; x.push_back(after[i][0]); y.push_back(-(sw - 1)); sw++; x.push_back(after[i][1]); y.push_back(after[i][2]); } else if (adj == 4) { sw++; x.push_back(-(sw+1)); y.push_back(-(sw+2)); conn[i] = -sw; sw++; x.push_back(after[i][0]); y.push_back(after[i][2]); sw++; x.push_back(after[i][1]); y.push_back(after[i][3]); } } answer(conn, 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...