Submission #542857

#TimeUsernameProblemLanguageResultExecution timeMemory
542857AJ00Dungeons Game (IOI21_dungeons)C++17
Compilation error
0 ms0 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
int N;
vector<int> s,p,w,l;
int simulate(int x, int z){
    int moves = 0;
    while(x != N){
        moves++;
        if (z >= s[x]){
            z += s[x];
            x = w[x];
        }
        else {
            z += p[x];
            x = l[x];
        }
    }
    return moves;
}
void init(int n, vector<int> _s, vector<int> _p, vector<int> _w,vector<int> _l){
    s = _s;
    p = _p;
    w = _w;
    l = _l;
    N = n;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc8Q4drD.o: in function `main':
grader.cpp:(.text.startup+0x3bd): undefined reference to `init(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x440): undefined reference to `simulate(int, int)'
collect2: error: ld returned 1 exit status