제출 #785499

#제출 시각아이디문제언어결과실행 시간메모리
785499Alfraganus동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
// #include "cave.h" #include "grader.c" #include <vector> using namespace std; void FillWithZero(vector<int> &a, vector<int> &used, int l, int r, bool flag) { for (int i = l; i <= r; i++) { if (used[i] != -1) a[i] = used[i]; else a[i] = flag; } for (int i = 0; i < l; i++) { if (used[i] != -1) a[i] = used[i]; else a[i] = -1; } for (int i = r + 1; i < (int)a.size(); i++) { if (used[i] != -1) a[i] = used[i]; else a[i] = -1; } } void exploreCave(int n) { vector<int> a(n), used(n, -1); int ra[n], k, d[n]; for (int j = 0; j < n; j++) { int l = 0, r = n - 1; bool flag = 0; while (l < r) { int m = (l + r) >> 1; FillWithZero(a, used, l, m, flag); for (int i = 0; i < n; i++) ra[i] = a[i]; k = tryCombination(ra); if (k == j) { if (flag) { l = m + 1; continue; } FillWithZero(a, used, m + 1, r, flag); for (int i = 0; i < n; i++) ra[i] = a[i]; k = tryCombination(ra); if (k == j) flag = 1; else l = m + 1; } else r = m; } d[l] = j; used[l] = flag; } for (int i = 0; i < n; i++) ra[i] = used[i]; answer(ra, d); }

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

/usr/bin/ld: /tmp/ccWE0Vl4.o: in function `answer':
cave.cpp:(.text+0x0): multiple definition of `answer'; /tmp/ccPILGZ5.o:grader.c:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccWE0Vl4.o: in function `tryCombination':
cave.cpp:(.text+0x80): multiple definition of `tryCombination'; /tmp/ccPILGZ5.o:grader.c:(.text+0x80): first defined here
/usr/bin/ld: /tmp/ccWE0Vl4.o: in function `init()':
cave.cpp:(.text+0x110): multiple definition of `init()'; /tmp/ccPILGZ5.o:grader.c:(.text+0x110): first defined here
/usr/bin/ld: /tmp/ccWE0Vl4.o: in function `main':
cave.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccPILGZ5.o:grader.c:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status