제출 #600629

#제출 시각아이디문제언어결과실행 시간메모리
600629piOOE콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess(int n) { string s; if (press("AB")) { if (press("A")) { s = "A"; } else { s = "B"; } } else { if (press("X")) { s = "X"; } else { s = "Y"; } } if (n == 1) { return s; } string L; if (s == "A") { L = "BXY"; } else if (s == "B") { L = "AXY"; } else if (s == "X") { L = "ABY"; } else { L = "ABX"; } for (int i = 1; i < n - 1; ++i) { string str[3] = {s + L[0], s + L[1], s + L[2]}; int val = press(str[0] + L[0] + str[0] + L[1] + str[0] + L[2] + str[1]); if (val == i + 2) { s += L[0]; } else if (val == i + 1) { s += L[1]; } else { s += L[2]; } } if (press(s + L[0]) == n) { return s + L[0]; } else if (press(s + L[1]) == n) { return s + L[1]; } else { return s + L[2]; } }

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

/usr/bin/ld: /tmp/ccxJXOem.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status