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<bits/stdc++.h>
#include "speedrun.h"
using namespace std;
const int maxn = 1024;
vector<int>v[maxn];
vector<int>tour;
int used[maxn];
void set_parent( int nb, int par )
{
int cnt = 1;
while( par != 0 )
{
setHint(nb,cnt,(par%2));
par /= 2;
}
}
void dfs( int w )
{
used[w] = 1;
tour.push_back(w);
int sz = v[w].size();
for( int i = 0; i < sz; i ++ )
{
int nb = v[w][i];
if( used[nb] == 0 )
{
set_parent(nb,w);
dfs(nb);
}
}
}
void set_next( int x, int y )
{
int cnt = 11;
while( y != 0 )
{
setHint(x,cnt,(y%2));
y /= 2;
}
}
void assignHints(int subtask, int N, int A[], int B[] )
{
setHintLen(20);
for( int i = 1; i < N; i ++ )
{
v[A[i]].push_back(B[i]);
v[B[i]].push_back(A[i]);
}
int sz = tour.size();
for( int i = 0; i < sz-1; i ++ )
{
int x = tour[i];
int y = tour[i+1];
set_next(x,y);
}
}
void speedrun(int subtask, int N, int start)
{
return;
}
# | 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... |