#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define pct __builtin_popcount
#define INF 1000000007
void create_circuit(int m, vector<int> a) {
int n = a.size();
a.pb(0);
vector<int> sc(m + 1, 0);
sc[0] = a[0];
if (n == 1) {
answer(sc, {}, {});
return;
}
for (int i = 1; i <= m; i ++) sc[i] = -1;
int p = 1;
while (p < n) p *= 2;
vector<int> wx(p-1, INF);
vector<int> wy(p-1, INF);
vector<bool> t(p-1, 0);
for (int i = 0; i < p/2-1; i ++) {
wx[i] = -(i*2+1 +1);
wy[i] = -(i*2+2 +1);
}
for (int i = 0; i < p; i ++) {
int x = 0;
while (x < p-1) {
if (t[x] == 1) {
t[x] = 0;
x = x*2+2;
} else {
t[x] = 1;
x = x*2+1;
}
}
int ne = -1;
if (i >= p-n) ne = a[i-(p-n)+1];
if (x%2) wx[(x-1)/2] = ne;
else wy[(x-1)/2] = ne;
}
answer(sc, wx, wy);
}
# |
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 |
1 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 |
1 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 |
1 ms |
204 KB |
Output is partially correct |
2 |
Correct |
54 ms |
5024 KB |
Output is correct |
3 |
Partially correct |
91 ms |
7460 KB |
Output is partially correct |
4 |
Partially correct |
101 ms |
8060 KB |
Output is partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1 ms |
204 KB |
Output is partially correct |
2 |
Correct |
54 ms |
5024 KB |
Output is correct |
3 |
Partially correct |
91 ms |
7460 KB |
Output is partially correct |
4 |
Partially correct |
101 ms |
8060 KB |
Output is partially correct |
5 |
Partially correct |
108 ms |
8500 KB |
Output is partially correct |
6 |
Partially correct |
118 ms |
8232 KB |
Output is partially correct |
7 |
Partially correct |
128 ms |
8372 KB |
Output is partially correct |
8 |
Partially correct |
105 ms |
8088 KB |
Output is partially correct |
9 |
Partially correct |
92 ms |
7496 KB |
Output is partially correct |
10 |
Partially correct |
140 ms |
8100 KB |
Output is partially correct |
11 |
Partially correct |
107 ms |
7988 KB |
Output is partially correct |
12 |
Partially correct |
115 ms |
7456 KB |
Output is partially correct |
13 |
Correct |
59 ms |
5660 KB |
Output is correct |
14 |
Partially correct |
103 ms |
7744 KB |
Output is partially correct |
15 |
Partially correct |
108 ms |
7748 KB |
Output is partially correct |
16 |
Partially correct |
4 ms |
588 KB |
Output is partially correct |
17 |
Correct |
56 ms |
5348 KB |
Output is correct |
18 |
Correct |
56 ms |
5304 KB |
Output is correct |
19 |
Partially correct |
92 ms |
7460 KB |
Output is partially correct |
20 |
Partially correct |
109 ms |
7988 KB |
Output is partially correct |
21 |
Partially correct |
105 ms |
7968 KB |
Output is partially correct |
22 |
Partially correct |
108 ms |
8048 KB |
Output is partially correct |