제출 #1345021

#제출 시각아이디문제언어결과실행 시간메모리
1345021yc11던전 (IOI21_dungeons)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define int long long
using namespace std;


vector<int> s1;
vector<int> p1;
vector<int> w1;
vector<int> l1;
int N;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
    s1 = s;
    p1 = p;
    w1 = w;
    l1 = l;
    N = n;
	return;
}

long long simulate(int x, int z) {
    while (x!=N){
        if (z>=s1[x]){
            z+=s1[x];
            x = w1[x];
        }
        else{
            z+=p1[x];
            x = l1[x];
        }
    }
	return (long long )z;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccXg3wqA.o: in function `main':
grader.cpp:(.text.startup+0x390): 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+0x404): undefined reference to `simulate(int, int)'
collect2: error: ld returned 1 exit status