#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
void create_circuit(int m, vector<int> a) {
int n = a.size();
int len = 0;
while((1<<len) < n + 1)len++;
vector <int> c(m + 1);
vector <int> x((1<<len) - 1);
vector <int> y((1<<len) - 1);
for(int i = 0;i < m + 1;i++){
c[i] = -1;
}
for(int i = 1;i < (1<<(len - 1));i++){
x[i - 1] = -(i*2);
y[i - 1] = -(i*2 + 1);
}
for(int i = (1<<(len - 1));i < (1<<len);i++){
int ord1 = 0,ord2 = 0;
int nr = i - (1<<(len - 1));
for(int j = 0;j < len - 1;j++){
if(nr>>j&1){
ord1|=(1<<(len - j - 2));
}
}
ord2 = ord1 + (1<<(len - 1));
if(ord1 < n){
x[i - 1] = a[ord1];
}else{
if(ord1 == (1<<len) - 1){
x[i - 1] = 0;
}else{
x[i - 1] = -1;
}
}
if(ord2 < n){
y[i - 1] = a[ord2];
}else{
if(ord2 == (1<<len) - 1){
y[i - 1] = 0;
}else{
y[i - 1] = -1;
}
}
//cout<<i<<' '<<ord1<<' '<<ord2<<'\n';
}
return answer(c,x,y);
}
/**
3 4
1 1 2 3
**/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
344 KB |
Output is partially correct |
2 |
Partially correct |
52 ms |
8500 KB |
Output is partially correct |
3 |
Partially correct |
51 ms |
8528 KB |
Output is partially correct |
4 |
Partially correct |
58 ms |
9552 KB |
Output is partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
0 ms |
344 KB |
Output is partially correct |
2 |
Partially correct |
52 ms |
8500 KB |
Output is partially correct |
3 |
Partially correct |
51 ms |
8528 KB |
Output is partially correct |
4 |
Partially correct |
58 ms |
9552 KB |
Output is partially correct |
5 |
Partially correct |
63 ms |
10048 KB |
Output is partially correct |
6 |
Partially correct |
60 ms |
9820 KB |
Output is partially correct |
7 |
Partially correct |
60 ms |
9820 KB |
Output is partially correct |
8 |
Partially correct |
59 ms |
9560 KB |
Output is partially correct |
9 |
Partially correct |
55 ms |
8532 KB |
Output is partially correct |
10 |
Partially correct |
71 ms |
9556 KB |
Output is partially correct |
11 |
Partially correct |
60 ms |
9392 KB |
Output is partially correct |
12 |
Partially correct |
52 ms |
8560 KB |
Output is partially correct |
13 |
Partially correct |
56 ms |
8540 KB |
Output is partially correct |
14 |
Partially correct |
54 ms |
8796 KB |
Output is partially correct |
15 |
Partially correct |
54 ms |
8796 KB |
Output is partially correct |
16 |
Partially correct |
2 ms |
604 KB |
Output is partially correct |
17 |
Correct |
32 ms |
5468 KB |
Output is correct |
18 |
Partially correct |
53 ms |
8528 KB |
Output is partially correct |
19 |
Partially correct |
52 ms |
8488 KB |
Output is partially correct |
20 |
Partially correct |
58 ms |
9556 KB |
Output is partially correct |
21 |
Partially correct |
57 ms |
9576 KB |
Output is partially correct |
22 |
Partially correct |
57 ms |
9556 KB |
Output is partially correct |