#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
int K, xx[200000], yy[200000];
vector<int> X, Y;
void f(int x, int v, int t){
if(x>K-2){
xx[v] = yy[v|t] = x;
return;
}
f(-X[x]-1, v, t<<1);
f(-Y[x]-1, v|t, t<<1);
}
void create_circuit(int M, vector<int> A) {
memset(xx, -1, sizeof(xx)), memset(yy, -1, sizeof(yy));
int N = A.size();
vector<int> C(M + 1);
K = 1;
while(K<(N+1)/2) K <<= 1;
X.resize(K*2-1), Y.resize(K*2-1);
fill(C.begin(), C.end(), -1);
for(int i=1; i<K; ++i){
X[i-1] = -(i<<1);
Y[i-1] = -(i<<1|1);
}
f(0, 0, 1);
for(int i=0; i<2*K; ++i){
if(i>=N){
if(xx[i]>=0) X[xx[i]] = -1;
else Y[yy[i]] = -1;
}
else if(xx[i]>=0) X[xx[i]] = A[i];
else Y[yy[i]] = A[i];
}
if(Y[yy[2*K-1]] == -1) Y[yy[2*K-1]] = 0;
else C[Y[yy[2*K-1]]] = 0;
answer(C, X, Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1740 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1740 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1740 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1740 KB |
Output is correct |
2 |
Incorrect |
3 ms |
1740 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2 ms |
1740 KB |
Output is partially correct |
2 |
Incorrect |
46 ms |
5944 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2 ms |
1740 KB |
Output is partially correct |
2 |
Incorrect |
46 ms |
5944 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |