답안 #644885

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644885 2022-09-25T12:20:16 Z PanTkd Speedrun (RMI21_speedrun) C++14
컴파일 오류
0 ms 0 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[node])
        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, father[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);
}



Compilation message

speedrun.cpp: In function 'void dfs(ll, ll)':
speedrun.cpp:48:23: error: 'node' was not declared in this scope
   48 |     for (auto it: Adj[node])
      |                       ^~~~
speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:70:30: error: 'father' was not declared in this scope
   70 |         setInteger(i + 1, 0, father[i + 1]);
      |                              ^~~~~~