# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768410 | 2023-06-28T05:46:37 Z | ono_de206 | Mechanical Doll (IOI18_doll) | C++14 | 1 ms | 212 KB |
#include "doll.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second // #define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; void create_circuit(int m, std::vector<int> a) { a.pb(0); int n = a.size(); vector<int> C(m + 1, 0), X, Y; const int inf = 1e9 + 10; reverse(all(a)); while(n & (n - 1)) { a.pb(inf); n++; } function<int(vector<int>&)> solve = [&](vector<int>& vec) { if(set<int>(all(vec)).size() == 1) return vec[0]; if(vec.size() == 2) { X.pb(vec[0]); Y.pb(vec[1]); } else { vector<int> first, second; for(int i = 0; i < (int)vec.size(); i += 2) { first.pb(vec[i]); second.pb(vec[i + 1]); } int id1 = solve(first), id2 = solve(second); X.pb(id1); Y.pb(id2); } return -(int)X.size(); }; C[0] = solve(a); for(int i = 1; i < C.size(); i++) { C[i] = C[0]; } for(int i = 0; i < X.size(); i++) { if(X[i] == inf) X[i] = C[0]; if(Y[i] == inf) Y[i] = C[0]; } answer(C, X, Y); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |