제출 #1249925

#제출 시각아이디문제언어결과실행 시간메모리
1249925Zicrus세계 지도 (IOI25_worldmap)C++20
컴파일 에러
0 ms0 KiB
#include "worldmap.h" #include <cassert> #include <cstdio> int main() { int T; assert(1 == scanf("%d", &T)); std::vector<int> Nt(T), Mt(T); std::vector<std::pair<std::vector<int>, std::vector<int>>> AB; for (int t = 0; t < T; ++t) { assert(2 == scanf("%d %d", &Nt[t], &Mt[t])); int M = Mt[t]; std::vector<int> A(M), B(M); for (int i = 0; i < Mt[t]; i++) { assert(2 == scanf("%d %d", &A[i], &B[i])); } AB.push_back(make_pair(A, B)); } fclose(stdin); std::vector<std::vector<std::vector<int>>> Ct; for (int t = 0; t < T; t++) { int N = Nt[t], M = Mt[t]; std::vector<int> A = AB[t].first, B = AB[t].second; auto C = create_map(N, M, A, B); Ct.push_back(C); } for (int t = 0; t < T; t++) { auto& C = Ct[t]; int P = (int)C.size(); std::vector<int> Q(P); for (int i = 0; i < P; ++i) Q[i] = (int)C[i].size(); printf("%d\n", P); for (int i = 0; i < P; ++i) printf("%d%c", Q[i], " \n"[i + 1 == P]); printf("\n"); for (int i = 0; i < P; i++) { for (int j = 0; j < Q[i]; j++) { printf("%d%c", C[i][j], " \n"[j + 1 == Q[i]]); } } if (t < T - 1) printf("\n"); } fclose(stdout); return 0; }

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

/usr/bin/ld: /tmp/ccoRh0AI.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccIHI6QU.o:worldmap.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccIHI6QU.o: in function `main':
worldmap.cpp:(.text.startup+0x6da): undefined reference to `create_map(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: /tmp/ccoRh0AI.o: in function `main':
grader.cpp:(.text.startup+0x635): undefined reference to `create_map(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status