제출 #243388

#제출 시각아이디문제언어결과실행 시간메모리
243388ant101늑대인간 (IOI18_werewolf)C++14
컴파일 에러
0 ms0 KiB
#include <cstdio> #include <cstdlib> #include <vector> #include "werewolf.h" namespace { int read_int() { int x; if (scanf("%d", &x) != 1) { fprintf(stderr, "Error while reading input\n"); exit(1); } return x; } } // namespace int main() { int N = read_int(); int M = read_int(); int Q = read_int(); std::vector<int> X(M), Y(M), S(Q), E(Q), L(Q), R(Q); for (int j = 0; j < M; ++j) { X[j] = read_int(); Y[j] = read_int(); } for (int i = 0; i < Q; ++i) { S[i] = read_int(); E[i] = read_int(); L[i] = read_int(); R[i] = read_int(); } std::vector<int> A = check_validity(N, X, Y, S, E, L, R); for (size_t i = 0; i < A.size(); ++i) { printf("%d\n", A[i]); } return 0; }

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

/tmp/ccW9VaCl.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccd4ozcC.o:werewolf.cpp:(.text.startup+0x0): first defined here
/tmp/ccd4ozcC.o: In function `main':
werewolf.cpp:(.text.startup+0x225): undefined reference to `check_validity(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> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/tmp/ccW9VaCl.o: In function `main':
grader.cpp:(.text.startup+0x25e): undefined reference to `check_validity(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> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status