제출 #1222189

#제출 시각아이디문제언어결과실행 시간메모리
1222189kargneq식물 비교 (IOI20_plants)C++20
컴파일 에러
0 ms0 KiB
#include <vector> using namespace std; vector<int> r, h; int n, k; void init(int kk, vector<int> rr, vector<int> hh) { k = kk; r = rr; h = hh; n = r.size(); } // Returns 1 if h is consistent with r, 0 otherwise int compare_plants() { for (int i = 0; i < n; ++i) { int cnt = 0; for (int j = 1; j < k; ++j) { int nxt = (i + j) % n; if (h[nxt] > h[i]) cnt++; } if (cnt != r[i]) { return 0; } } return 1; }

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

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