답안 #644886

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644886 2022-09-25T12:21:40 Z PanTkd Speedrun (RMI21_speedrun) C++14
0 / 100
1 ms 480 KB
#include "speedrun.h"
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
#ifdef px
    #define p(x) cerr<<#x<<' '<<x<<endl;
#else
    #define p(x) {}
#endif
#define F first
#define S second
#define sz size
#define ls s,m,idx<<1
#define rs m+1,e,idx<<1|1
const ll MOD=ll(1e9)+7;
const ll MAXN=2*ll(1e6);

ll freq[1001],euler[1001],idx=0;
ll arxi;

vector<vi> Adj;
vi Par,Son;
void dfs(ll s,ll p=0){
    Par[s] = p;
    euler[idx++] = s;

    for (auto it: Adj[s])
        if (it != p) {
            dfs(it, s);
        }
}
void setInteger(ll pou, ll id, ll val){
    ll posa= id*10+1;
    for(ll i=0;i<10;i++){
        if((1<<i)&val){
            setHint(pou,posa+i,1);
        }
    }
}
void assignHints(int subtask, int N, int A[], int B[]) { 
    setHintLen(20);
    for (int i = 1; i <= N - 1; ++i) {
        Adj[A[i]].push_back(B[i]);
        Adj[B[i]].push_back(A[i]);
    }
    dfs(1);

    for (int i = 0; i < N; ++i) {
        setInteger(i + 1, 0, Par[i + 1]);
        setInteger(euler[i], 1, euler[(i + 1) % N]);
    }
}
ll l;

ll readInteger(ll id){
    ll posa=id*10+1;
    ll val=0;
    for(ll i=0;i<10;i++){
        val^=(getHint(posa+i)<<i);
    }
    return val;
}
void speedrun(int subtask, int N, int start) { /* your solution here */
    int node = start;
    do {
        int target = readInteger(1);
        while (!goTo(target)) {
            node = readInteger(0);
            goTo(node);
        }
        node = target;
    } while (node != start);
}



# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 480 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -