제출 #1038508

#제출 시각아이디문제언어결과실행 시간메모리
1038508attky동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int n) { int state[n], pos[n]; bool good[n]; for(int loop = 0; loop < n; ++loop) { good[loop] = false; pos[loop] = -1; } for(int loop = 0; loop < n; ++loop) { for(int looping = 0; looping < n; ++looping) { if(!good[looping]) { state[looping] = 1; } } int ans = tryCombination(state)-1; if(ans < 0) { ans = 2e9; } bool closed = (ans == loop); int deb = 0, fin = n-1; while(fin-deb > 0) { int mid = (deb+fin)/2; for(int looping = mid+1; looping <= fin; ++looping) { if(!good[looping]) { state[looping] = 1-state[looping]; } } int newAns = tryCombination(state)-1; if(newAns < 0) { newAns = 2e9; } bool newClosed = (ans == loop); if((newClosed && closed) || (!newClosed && !closed)) { fin = mid; } else { deb = mid+1; } } good[deb] = true; pos[deb] = loop+1; } answer(state, pos); }

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

/usr/bin/ld: /tmp/ccqmY7oM.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
/usr/bin/ld: /tmp/cc03lwhN.o: in function `exploreCave(int)':
cave.cpp:(.text+0x18d): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x205): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x25e): undefined reference to `answer(int*, int*)'
collect2: error: ld returned 1 exit status