#include <bits/stdc++.h>
#include "doll.h"
using namespace std;
int N;
vector<int> X;
vector<int> Y;
vector<int> nullVector;
vector<int> onlyTrigger;
/*void answer(vector<int> C, vector<int> xx, vector<int> yy)
{
for(int g = 0 ; g < C.size() ; g++)
printf("%d ",C[g]);
printf("\n\n");
for(int g = 0 ; g < X.size() ; g++)
printf("%d %d\n",X[g],Y[g]);
}*/
void create_circuit(int M, vector<int> A)
{
N = A.size();
onlyTrigger.push_back( 0 );
//printf("N = %d\n",N);
if(N == 1)
{
answer(onlyTrigger , nullVector , nullVector);
return;
}
N--;
int logN = log2( N );
logN++;
//printf("log = %d\n",logN);
X.resize( logN);
Y.resize( logN );
for(int g = 0 ; g < logN - 1 ; g++)
{
if(N & (1 << g))
{
X[ g ] = 1;//VER O ULTIMO
Y[ g ] = -g - 2;
}
else
{
X[ g ] = -g - 2;
Y[ g ] = 1;
}
}
if(N & (1 << (logN - 1)))
{
X[ logN - 1 ] = 1;
Y[ logN - 1 ] = 0;
}
else
{
X[ logN - 1 ] = 0;
Y[ logN - 1 ] = 1;
}
answer(onlyTrigger , X , Y);
}
/*int main()
{
int kk;
scanf("%d",&kk);
vector<int> aux;
for(int g = 0 ; g < kk ; g++)
aux.push_back( 1 );
create_circuit(1 , aux);
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer: wrong array length |
2 |
Halted |
0 ms |
0 KB |
- |