Submission #991688

# Submission time Handle Problem Language Result Execution time Memory
991688 2024-06-02T19:29:45 Z Abito Speedrun (RMI21_speedrun) C++17
8 / 100
31 ms 768 KB
#include "speedrun.h"
#include <bits/stdc++.h>
using namespace std;
void assignHints(int subtask, int n, int A[], int B[]) {
    setHintLen(20);
    int deg[n+2];
    for (int i=1;i<=n;i++) deg[i]=0;
    for (int i=1;i<n;i++) deg[A[i]]++,deg[B[i]]++;
    int root=1;
    for (int i=1;i<=n;i++) if (deg[i]>deg[root]) root=i;
    for (int j=0;j<20;j++){
        if (!(root&(1<<j))) continue;
        for (int i=1;i<=n;i++) setHint(i,j+1,1);
    }
    return;
}

void speedrun(int subtask, int n, int start) {
    int root=0;
    for (int i=1;i<=20;i++) if (getHint(i)) root+=(1<<(i-1));
    if (root!=start) goTo(root);
    for (int i=1;i<=n;i++){
        if (i==root) continue;
        goTo(i);
        goTo(root);
    }return;
    return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 768 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 31 ms 688 KB Output is correct
2 Correct 26 ms 756 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 764 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 756 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 684 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -