#include "doll.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
vector<int> C, X, Y;
int mx = 2;
vector<bool> tree((1 << 18) + 5, true);
void rec(int index, int value)
{
if (index >= mx / 2)
{
if (tree[index])
X[index - 1] = value;
else
Y[index - 1] = value;
}
else if (tree[index])
rec(index * 2, value);
else
rec(index * 2 + 1, value);
tree[index] = !tree[index];
}
void create_circuit(int M, std::vector<int> A)
{
int N = A.size();
while (mx < N)
mx *= 2;
X.resize(mx - 1);
fill(X.begin(), X.end(), -1);
Y = X;
C.resize(M + 1);
fill(C.begin(), C.end(), -1);
C[0] = A[0];
for (int i = 1; i < mx / 2; i++)
{
X[i - 1] = i * -2;
Y[i - 1] = i * -2 - 1;
}
for (int i = 1; i < N; i++)
rec(1, A[i]);
Y[Y.size() - 1] = 0;
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
2 ms |
204 KB |
Output is partially correct |
2 |
Correct |
84 ms |
4424 KB |
Output is correct |
3 |
Partially correct |
99 ms |
7504 KB |
Output is partially correct |
4 |
Partially correct |
127 ms |
8004 KB |
Output is partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
2 ms |
204 KB |
Output is partially correct |
2 |
Correct |
84 ms |
4424 KB |
Output is correct |
3 |
Partially correct |
99 ms |
7504 KB |
Output is partially correct |
4 |
Partially correct |
127 ms |
8004 KB |
Output is partially correct |
5 |
Partially correct |
129 ms |
8892 KB |
Output is partially correct |
6 |
Partially correct |
130 ms |
8772 KB |
Output is partially correct |
7 |
Partially correct |
144 ms |
8888 KB |
Output is partially correct |
8 |
Partially correct |
114 ms |
8492 KB |
Output is partially correct |
9 |
Partially correct |
128 ms |
7500 KB |
Output is partially correct |
10 |
Partially correct |
119 ms |
8492 KB |
Output is partially correct |
11 |
Partially correct |
116 ms |
8152 KB |
Output is partially correct |
12 |
Partially correct |
94 ms |
7860 KB |
Output is partially correct |
13 |
Correct |
67 ms |
4672 KB |
Output is correct |
14 |
Partially correct |
103 ms |
8212 KB |
Output is partially correct |
15 |
Partially correct |
95 ms |
8464 KB |
Output is partially correct |
16 |
Partially correct |
4 ms |
588 KB |
Output is partially correct |
17 |
Correct |
70 ms |
4452 KB |
Output is correct |
18 |
Correct |
66 ms |
4432 KB |
Output is correct |
19 |
Partially correct |
96 ms |
7736 KB |
Output is partially correct |
20 |
Partially correct |
127 ms |
8276 KB |
Output is partially correct |
21 |
Partially correct |
113 ms |
8140 KB |
Output is partially correct |
22 |
Partially correct |
119 ms |
8196 KB |
Output is partially correct |