#include<bits/stdc++.h>
#include "doll.h"
using namespace std;
using ll = long long;
void create_circuit(int m, std::vector<int> arr) {
vector<int> c(m+1);
vector<int> x, y;
auto add = [&](int a, int b){
x.push_back(a), y.push_back(b);
return -(int)x.size();
};
auto tree = [&](auto& tree, vector<int> nxt) {
if (nxt.size() == 1) {
return nxt[0];
}
vector<int> odd, even;
for (int i = 0; i < (int)nxt.size(); i += 2) {
odd.push_back(nxt[i]);
even.push_back(nxt[i+1]);
}
int t1 = tree(tree, odd);
int t2 = tree(tree, even);
return add(t1, t2);
};
arr.push_back(0);
reverse(arr.begin(), arr.end());
while (__builtin_popcount(arr.size()) > 1)
arr.push_back(INT_MAX);
reverse(arr.begin(), arr.end());
c[0] = tree(tree, arr);
for (int i = 0; i < (int)x.size(); i++) {
if (x[i] == INT_MAX)
x[i] = c[0];
if (y[i] == INT_MAX)
y[i] = c[0];
}
for (int i = 1; i <= m; i++)
c[i] = c[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 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
212 KB |
Output is partially correct |
2 |
Partially correct |
117 ms |
10184 KB |
Output is partially correct |
3 |
Partially correct |
125 ms |
10232 KB |
Output is partially correct |
4 |
Partially correct |
137 ms |
10312 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
212 KB |
Output is partially correct |
2 |
Partially correct |
117 ms |
10184 KB |
Output is partially correct |
3 |
Partially correct |
125 ms |
10232 KB |
Output is partially correct |
4 |
Partially correct |
137 ms |
10312 KB |
Output is partially correct |
5 |
Partially correct |
125 ms |
11148 KB |
Output is partially correct |
6 |
Partially correct |
137 ms |
11036 KB |
Output is partially correct |
7 |
Partially correct |
126 ms |
11168 KB |
Output is partially correct |
8 |
Partially correct |
132 ms |
10916 KB |
Output is partially correct |
9 |
Partially correct |
112 ms |
10152 KB |
Output is partially correct |
10 |
Partially correct |
127 ms |
10776 KB |
Output is partially correct |
11 |
Partially correct |
120 ms |
10464 KB |
Output is partially correct |
12 |
Partially correct |
115 ms |
10520 KB |
Output is partially correct |
13 |
Partially correct |
116 ms |
10788 KB |
Output is partially correct |
14 |
Partially correct |
118 ms |
10944 KB |
Output is partially correct |
15 |
Partially correct |
124 ms |
11228 KB |
Output is partially correct |
16 |
Partially correct |
4 ms |
596 KB |
Output is partially correct |
17 |
Correct |
67 ms |
5436 KB |
Output is correct |
18 |
Partially correct |
113 ms |
10424 KB |
Output is partially correct |
19 |
Partially correct |
113 ms |
10504 KB |
Output is partially correct |
20 |
Partially correct |
133 ms |
10656 KB |
Output is partially correct |
21 |
Partially correct |
120 ms |
10352 KB |
Output is partially correct |
22 |
Partially correct |
118 ms |
10420 KB |
Output is partially correct |