Submission #504841

# Submission time Handle Problem Language Result Execution time Memory
504841 2022-01-10T09:10:01 Z socpite Speedrun (RMI21_speedrun) C++14
0 / 100
1 ms 340 KB
#include<bits/stdc++.h>
#include<speedrun.h>
using namespace std;

vector<vector<int>> graph;
vector<int> order;

void sh(int pos, int id, int val){
    for(int i = 0; i < 10; i++){
        setHint(pos, i + id*10, val&(1<<i));
    }
}

void DFS(int x, int p){
    sh(x, 0, p);
    order.push_back(x);
    for(auto v: graph[x])if(v!=p)DFS(v, x);
}

int gtval(int id){
    int re = 0;
    for(int i = 0; i < 10; i++){
        re|=(getHint(i+id*10)<<i);
    }
    return re;
}

void assignHints (int subtask , int n, int A[], int B[]){
    setHintLen(20);
    graph.resize(n+1);
    for(int i = 1; i < n; i++){
        graph[A[i]].push_back(B[i]);
        graph[B[i]].push_back(A[i]);
    }
    DFS(1, 0);
    for(int i = 0; i < n-1; i++){
        sh(order[i], 1, order[i+1]);
    }
    sh(order[n-1], 1, 0);
}

void speedrun(int subtask , int N, int start ){
    int suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu = getLength();
    while(gtval(0)){
        goTo(gtval(0));
    }
    int curr = gtval(1);
    while(curr){
        while(!goTo(curr))goTo(gtval(0));
        curr = gtval(1);
    }
}

Compilation message

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:43:9: warning: unused variable 'suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu' [-Wunused-variable]
   43 |     int suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu = getLength();
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -