# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430257 | 2021-06-16T12:33:42 Z | TheWilp | Mechanical Doll (IOI18_doll) | C++14 | 219 ms | 17800 KB |
#include "doll.h" #include <vector> #include <iostream> std::vector<int> f[100005]; int cnt = 1; std::vector<int> C; std::vector<int> X; std::vector<int> Y; int create(int pos,std::vector<int> v){ if(v.size() == 1) return v[0]; int node_create = cnt++; X.push_back(0);Y.push_back(0); std::vector<int> vleft; std::vector<int> vright; for(int q = 0 ;q<v.size();q+=2){ vleft.push_back(v[q]); } for(int q = 1;q<v.size();q+=2){ vright.push_back(v[q]); } if(vleft.size() > vright.size()){ vright.push_back(vleft.back()); vleft.back() = -node_create; } int get1 = create(pos,vleft); int get2 = create(pos,vright); X[node_create - 1] = get1; Y[node_create - 1] = get2; return -node_create; } void print_vector(std::vector<int>& v){ for(int q = 0 ;q<v.size();q++){ std::cout << v[q] << " "; }std::cout << std::endl; } void create_circuit(int M, std::vector<int> A) { for(int q = 1;q<A.size();q++){ f[A[q - 1]].push_back(A[q]); } f[A.back()].push_back(0); C.push_back(A[0]); for(int q = 1 ;q<=M;q++){ if(f[q].size() == 0) C.push_back(0); else C.push_back(create(q,f[q])); } //print_vector(C); //print_vector(X); //print_vector(Y); answer(C,X,Y); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | Output is correct |
2 | Correct | 34 ms | 6416 KB | Output is correct |
3 | Correct | 28 ms | 6044 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 13 ms | 3860 KB | Output is correct |
6 | Correct | 46 ms | 7772 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | Output is correct |
2 | Correct | 34 ms | 6416 KB | Output is correct |
3 | Correct | 28 ms | 6044 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 13 ms | 3860 KB | Output is correct |
6 | Correct | 46 ms | 7772 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 92 ms | 8640 KB | Output is correct |
9 | Correct | 72 ms | 8884 KB | Output is correct |
10 | Correct | 103 ms | 11076 KB | Output is correct |
11 | Correct | 3 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 2 ms | 2636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | Output is correct |
2 | Correct | 34 ms | 6416 KB | Output is correct |
3 | Correct | 28 ms | 6044 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 13 ms | 3860 KB | Output is correct |
6 | Correct | 46 ms | 7772 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 92 ms | 8640 KB | Output is correct |
9 | Correct | 72 ms | 8884 KB | Output is correct |
10 | Correct | 103 ms | 11076 KB | Output is correct |
11 | Correct | 3 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 2 ms | 2636 KB | Output is correct |
14 | Correct | 131 ms | 12856 KB | Output is correct |
15 | Correct | 70 ms | 7600 KB | Output is correct |
16 | Correct | 109 ms | 10292 KB | Output is correct |
17 | Correct | 2 ms | 2636 KB | Output is correct |
18 | Correct | 3 ms | 2632 KB | Output is correct |
19 | Correct | 2 ms | 2636 KB | Output is correct |
20 | Correct | 122 ms | 11660 KB | Output is correct |
21 | Correct | 2 ms | 2636 KB | Output is correct |
22 | Correct | 2 ms | 2636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2636 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 2 ms | 2636 KB | Output is partially correct |
2 | Correct | 82 ms | 8412 KB | Output is correct |
3 | Partially correct | 137 ms | 14376 KB | Output is partially correct |
4 | Partially correct | 151 ms | 13168 KB | Output is partially correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 2 ms | 2636 KB | Output is partially correct |
2 | Correct | 82 ms | 8412 KB | Output is correct |
3 | Partially correct | 137 ms | 14376 KB | Output is partially correct |
4 | Partially correct | 151 ms | 13168 KB | Output is partially correct |
5 | Partially correct | 167 ms | 14752 KB | Output is partially correct |
6 | Partially correct | 186 ms | 15812 KB | Output is partially correct |
7 | Partially correct | 189 ms | 15496 KB | Output is partially correct |
8 | Partially correct | 196 ms | 16420 KB | Output is partially correct |
9 | Partially correct | 135 ms | 12328 KB | Output is partially correct |
10 | Partially correct | 202 ms | 17800 KB | Output is partially correct |
11 | Partially correct | 219 ms | 16984 KB | Output is partially correct |
12 | Partially correct | 134 ms | 12044 KB | Output is partially correct |
13 | Partially correct | 122 ms | 11164 KB | Output is partially correct |
14 | Partially correct | 117 ms | 10980 KB | Output is partially correct |
15 | Partially correct | 109 ms | 10556 KB | Output is partially correct |
16 | Partially correct | 5 ms | 2892 KB | Output is partially correct |
17 | Partially correct | 109 ms | 9856 KB | Output is partially correct |
18 | Partially correct | 122 ms | 9828 KB | Output is partially correct |
19 | Partially correct | 124 ms | 10424 KB | Output is partially correct |
20 | Partially correct | 158 ms | 12552 KB | Output is partially correct |
21 | Partially correct | 210 ms | 14924 KB | Output is partially correct |
22 | Partially correct | 164 ms | 11924 KB | Output is partially correct |