# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
946492 | 2024-03-14T17:17:58 Z | PagodePaiva | Mechanical Doll (IOI18_doll) | C++17 | 1 ms | 348 KB |
#include "doll.h" #include<bits/stdc++.h> using namespace std; void create_circuit(int M, std::vector<int> A) { vector <int> v; v.push_back(0); for(auto x : A) v.push_back(x); int m = M; int n = v.size(); vector <int> c, x, y; vector <int> g[m+1]; v.push_back(0); for(int i = 0;i < (int) (v.size()) - 1;i++){ int val = v[i], nx = v[i+1]; g[val].push_back(nx); } int tp = -1; for(int i = 0;i <= m;i++){ if(g[i].size() == 0) { c.push_back(0); continue; } if(g[i].size() == 1){ c.push_back(g[i][0]); continue; } if(g[i].size() == 2){ c.push_back(tp); x.push_back(g[i][0]); y.push_back(g[i][1]); tp--; continue; } if(g[i].size() == 3){ c.push_back(tp); tp--; x.push_back(tp); y.push_back(g[i][2]); x.push_back(g[i][0]); y.push_back(g[i][1]); tp--; continue; } if(g[i].size() == 4){ c.push_back(tp); tp--; x.push_back(tp); y.push_back(tp-1); x.push_back(g[i][0]); y.push_back(g[i][1]); tp--; tp--; x.push_back(g[i][2]); y.push_back(g[i][3]); } } for(auto t : c){ cout << t << ' '; } answer(c, x, y); return; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |