This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "doll.h"
#include<bits/stdc++.h>
void create_circuit(int M, std::vector<int> A) {
int N = A.size();
std::vector<int> x,y;
std::vector<int> c;
int n = N;
c[0] = 1;
std::vector<int> node[100005];
for(int i=1; i<=n-1; i++)
{
int qq = A[i];
node[qq].push_back(A[i+1]);
}
int xx = A[n];
node[xx].push_back(0);
for(int i=1;i<=M;i++) //that means we deal with the sensor.
{
int sum = node[i].size();
if(sum == 1)
{
int kx = node[i][0];
c.push_back(kx);
}
else
{
sum+=1;
int dd=1;
for(int j=1;j<=100;j++)
{
dd*=2; //that means we should create how many hiearachy
if(dd >= sum)
{
break;
}
}
}
}
answer(c,x,y);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |