#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> A, C, X, Y;
int N, M, K;
void build(int id, int depth, int cur) {
if (depth == K - 1) {
X[id - 1] = (cur < N - 1 ? A[cur + 1] : (cur == ((1 << K) - 1) ? 0 : -1));
cur += 1 << depth;
Y[id - 1] = (cur < N - 1 ? A[cur + 1] : (cur == ((1 << K) - 1) ? 0 : -1));
return;
}
X[id - 1] = -(id * 2);
Y[id - 1] = -(id * 2 + 1);
build(id * 2, depth + 1, cur);
build(id * 2 + 1, depth + 1, cur + (1 << depth));
}
void create_circuit(int _M, vector<int> _A) {
A = _A;
N = A.size();
M = _M;
K = 0;
while ((1 << K) < N) {
K++;
}
C.resize(M + 1, -1);
C[0] = A[0];
if (K == 0) {
answer(C, X, Y);
return;
}
X.resize((1 << K) - 1);
Y.resize((1 << K) - 1);
build(1, 0, 0);
answer(C, X, Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
212 KB |
Output is partially correct |
2 |
Correct |
29 ms |
4920 KB |
Output is correct |
3 |
Partially correct |
47 ms |
8140 KB |
Output is partially correct |
4 |
Partially correct |
52 ms |
8920 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
212 KB |
Output is partially correct |
2 |
Correct |
29 ms |
4920 KB |
Output is correct |
3 |
Partially correct |
47 ms |
8140 KB |
Output is partially correct |
4 |
Partially correct |
52 ms |
8920 KB |
Output is partially correct |
5 |
Partially correct |
59 ms |
9768 KB |
Output is partially correct |
6 |
Partially correct |
58 ms |
9624 KB |
Output is partially correct |
7 |
Partially correct |
56 ms |
9740 KB |
Output is partially correct |
8 |
Partially correct |
57 ms |
9392 KB |
Output is partially correct |
9 |
Partially correct |
53 ms |
8160 KB |
Output is partially correct |
10 |
Partially correct |
56 ms |
9360 KB |
Output is partially correct |
11 |
Partially correct |
61 ms |
9284 KB |
Output is partially correct |
12 |
Partially correct |
48 ms |
8436 KB |
Output is partially correct |
13 |
Correct |
31 ms |
5212 KB |
Output is correct |
14 |
Partially correct |
50 ms |
8908 KB |
Output is partially correct |
15 |
Partially correct |
53 ms |
9004 KB |
Output is partially correct |
16 |
Partially correct |
2 ms |
596 KB |
Output is partially correct |
17 |
Correct |
29 ms |
4940 KB |
Output is correct |
18 |
Correct |
29 ms |
4940 KB |
Output is correct |
19 |
Partially correct |
48 ms |
8380 KB |
Output is partially correct |
20 |
Partially correct |
54 ms |
9268 KB |
Output is partially correct |
21 |
Partially correct |
53 ms |
8944 KB |
Output is partially correct |
22 |
Partially correct |
58 ms |
9020 KB |
Output is partially correct |