#include <bits/stdc++.h>
#include "doll.h"
using namespace std;
#define SIZE(x) (int)x.size()
#define forn(i,n) for(int i=0;i<int(n);i++)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define pb push_back
typedef vector<int> vi;
int n;
void dfs(int u, vi &v, vi &s, int a) {
if(u>=n) {
v[u]=a;
return;
}
s[u]^=1;
if(s[u]) dfs(2*u,v,s,a);
else dfs(2*u+1,v,s,a);
}
void create_circuit(int m, vi a) {
vi c(m+1);
c[0]=a[0];
forsn(i,1,m+1) c[i]=-1;
n=SIZE(a);
a.pb(0);
vi v(2*n,0), s(n,0);
forn(i,n) v[i] = -i-1;
forsn(i,1,n+1) dfs(0,v,s,a[i]);
vi state(2*n,0);
vi x(n), y(n);
forn(i,n) x[i]=v[2*i], y[i]=v[2*i+1];
answer(c,x,y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
state 'Y' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
state 'Y' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
state 'Y' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
state 'Y' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
state 'Y' |
2 |
Halted |
0 ms |
0 KB |
- |