제출 #523223

#제출 시각아이디문제언어결과실행 시간메모리
523223marat0210던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include <dungeons.h> #include <bits/stdc++.h> using namespace std; vector <long long> a, b, win, lose; void init(long long n, vector <long long> s, vector <long long> p, vector <long long> w, vector <long long> l) { for (int i = 0; i < n; ++i) { a.push_back(s[i]); b.push_back(p[i]); win.push_back(w[i]); lose.push_back(l[i]); } } long long simulate(long long x, long long z) { long long cur = z, d = x; while (1) { if (d == (long long)a.size()) { break; } if (cur >= a[d]) { cur += a[d]; d = win[d]; } else { cur += b[d]; d = lose[d]; } } return cur; }

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

/usr/bin/ld: /tmp/ccHZyGeU.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