제출 #109695

#제출 시각아이디문제언어결과실행 시간메모리
109695polyfish자리 배치 (IOI18_seats)C++14
컴파일 에러
0 ms0 KiB
#include <cstdio> #include <cstdlib> #include <vector> #include "seats.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() { freopen("data.in", "r", stdin); int H = read_int(); int W = read_int(); int Q = read_int(); std::vector<int> R(H * W), C(H * W); for (int i = 0; i < H * W; ++i) { R[i] = read_int(); C[i] = read_int(); } std::vector<int> A(Q), B(Q); for (int j = 0; j < Q; ++j) { A[j] = read_int(); B[j] = read_int(); } give_initial_chart(H, W, R, C); for (int j = 0; j < Q; ++j) { int answer = swap_seats(A[j], B[j]); printf("%d\n", answer); } return 0; }

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

seats.cpp: In function 'int main()':
seats.cpp:20:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   freopen("data.in", "r", stdin);
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccRBA0wv.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccn4rfSm.o:seats.cpp:(.text.startup+0x0): first defined here
/tmp/ccn4rfSm.o: In function `main':
seats.cpp:(.text.startup+0x16a): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
seats.cpp:(.text.startup+0x1c1): undefined reference to `swap_seats(int, int)'
/tmp/ccRBA0wv.o: In function `main':
grader.cpp:(.text.startup+0x183): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
grader.cpp:(.text.startup+0x220): undefined reference to `swap_seats(int, int)'
collect2: error: ld returned 1 exit status