제출 #1164631

#제출 시각아이디문제언어결과실행 시간메모리
1164631crispxx동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define eb emplace_back #define pb push_back #define ar array #define nl '\n' #include "cave.h" #include "grader.c" const int mxN = 5e3 + 5; bool is[mxN]; int S[mxN], D[mxN]; void exploreCave(int n) { auto opens = [&](int got, int trg) { return got == -1 || got > trg; }; auto color = [&](int trg) { int q[n]{}; for(int i = 0; i < n; i++) { if(is[i]) q[i] = S[i]; } if(opens(tryCombination(q), trg)) return 0; else return 1; }; auto Dnc = [&](auto &&self, int l, int r, int trg, int col) -> void { if(l == r) { is[l] = true; S[l] = col; D[l] = trg; return; } int q[n]; int m = (l + r) >> 1; for(int i = 0; i < n; i++) { if(is[i]) q[i] = S[i]; else if(i >= l && i <= m) q[i] = col; else q[i] = col ^ 1; } if(opens(tryCombination(q), trg)) { self(self, l, m, trg, col); } else { self(self, m + 1, r, trg, col); } }; for(int i = 0; i < n; i++) { Dnc(Dnc, 0, n - 1, i, color(i)); } answer(S, D); }

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

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