# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
647360 |
2022-10-02T09:49:17 Z |
Niya |
Speedrun (RMI21_speedrun) |
C++14 |
|
2 ms |
780 KB |
#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 |
1 |
Incorrect |
2 ms |
736 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
748 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
748 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
756 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
780 KB |
Solution didn't visit every node |
2 |
Halted |
0 ms |
0 KB |
- |