#include<bits/stdc++.h>
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define pb push_back
using namespace std;
#include "doll.h"
int n;
vector<int> C, X(1, 1e9), Y(1, 1e9);
vector<int> vis(1e6, 0);
int l;
int new_node(){
X.pb(1e9);
Y.pb(1e9);
return sz(X) - 1;
}
int build(int x, int d, int v){
if(d == l) return v;
if(x == 1e9) x = new_node();
else x = -x - 1;
vis[x]++;
if(vis[x] % 2){
int k = build(X[x], d + 1, v);
X[x] = k;
}
else{
int k = build(Y[x], d + 1, v);
Y[x] = k;
}
return -x - 1;
}
void create_circuit(int M, std::vector<int> A) {
n = A.size();
C = vector<int>(M + 1, -1);
l = ceil(log2(n + 1));
for(auto x : A){
build(-1, 0, x);
}
for(int i = n + 1; i < (1 << l); i++) build(-1, 0, -1);
build(-1, 0, 0);
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4172 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4172 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
4172 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4116 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
4 ms |
4172 KB |
Output is partially correct |
2 |
Partially correct |
146 ms |
11632 KB |
Output is partially correct |
3 |
Partially correct |
141 ms |
11612 KB |
Output is partially correct |
4 |
Partially correct |
149 ms |
12156 KB |
Output is partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
4 ms |
4172 KB |
Output is partially correct |
2 |
Partially correct |
146 ms |
11632 KB |
Output is partially correct |
3 |
Partially correct |
141 ms |
11612 KB |
Output is partially correct |
4 |
Partially correct |
149 ms |
12156 KB |
Output is partially correct |
5 |
Partially correct |
170 ms |
13016 KB |
Output is partially correct |
6 |
Partially correct |
161 ms |
12688 KB |
Output is partially correct |
7 |
Partially correct |
155 ms |
12752 KB |
Output is partially correct |
8 |
Partially correct |
182 ms |
12588 KB |
Output is partially correct |
9 |
Partially correct |
134 ms |
11616 KB |
Output is partially correct |
10 |
Partially correct |
149 ms |
12436 KB |
Output is partially correct |
11 |
Partially correct |
156 ms |
12160 KB |
Output is partially correct |
12 |
Partially correct |
136 ms |
11780 KB |
Output is partially correct |
13 |
Partially correct |
145 ms |
12132 KB |
Output is partially correct |
14 |
Partially correct |
147 ms |
12172 KB |
Output is partially correct |
15 |
Partially correct |
155 ms |
12324 KB |
Output is partially correct |
16 |
Partially correct |
8 ms |
4428 KB |
Output is partially correct |
17 |
Correct |
77 ms |
8452 KB |
Output is correct |
18 |
Partially correct |
137 ms |
11836 KB |
Output is partially correct |
19 |
Partially correct |
140 ms |
11912 KB |
Output is partially correct |
20 |
Partially correct |
151 ms |
12280 KB |
Output is partially correct |
21 |
Partially correct |
151 ms |
12244 KB |
Output is partially correct |
22 |
Partially correct |
148 ms |
12164 KB |
Output is partially correct |