Submission #765164

# Submission time Handle Problem Language Result Execution time Memory
765164 2023-06-24T08:59:30 Z vjudge1 Speedrun (RMI21_speedrun) C++17
0 / 100
66 ms 672 KB
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include "speedrun.h"

// Akhmet Issa

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ent "\n"

const int maxn = 1e3 + 100;
const ll INF = (ll)2e18;
const int inf = (ll)2e9;
const int maxl = 20;
const int MOD = 1e9 + 7;

vector<int> g[maxn];

void assignHints(int subtask, int n, int A [], int B []){
    for(int i = 1; i < n; i++){
        g[A[i]].push_back(B[i]);
        g[B[i]].push_back(A[i]);
    }
    setHintLen(20);
    for(int i = 1; i <= n; i++){
        int p = 1;
        for(int to: g[i]){
            for(int j = 0; j < 10; j++){
                if(to & (1<<j)) setHint(i, p, 1);
                p++;
            }
        }
    }
}

void dfs(int v, int pr){
    for(int p = 1; p <= 11; p += 10){
        int to = 0;
        for(int j = 0; j < 10; j++){
            if(getHint(j + p)) to |= (1<<j);
        }
        if(to != pr){
            goTo(to);
            dfs(to, v);
        }
    }
    if(pr) goTo(pr);
}

void speedrun(int subtask, int n, int start){
    dfs(start, 0);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 66 ms 672 KB Invalid node index to goTo
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -