Submission #991687

# Submission time Handle Problem Language Result Execution time Memory
991687 2024-06-02T19:29:17 Z Abito Speedrun (RMI21_speedrun) C++17
0 / 100
23 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<=n;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 5 ms 684 KB Invalid bit index for getHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 744 KB Invalid bit index for getHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 768 KB Invalid bit index for getHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 744 KB Invalid bit index for getHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 684 KB Invalid bit index for getHint
2 Halted 0 ms 0 KB -