Submission #282773

#TimeUsernameProblemLanguageResultExecution timeMemory
282773fvdqyxmCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <string> using namespace std; int press(string p){ int ans; cin >> ans; return ans; cout.flush(); } string guess_sequence(int N) { string cur = ""; string options = "ABXY"; string ans = ""; for(int i = 1; i <= N; i++) { for(int j = 0; j < 4; j++){ cur += options[j]; cout << cur << endl; int ans = press(cur); if(ans == i) { ans += options[j]; break; } else{ cur.pop_back(); } } } return ans; } int main () { int N; cin >> N; cout << guess_sequence(N) << '\n'; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccTZv6PN.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccH0j2MN.o:combo.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccTZv6PN.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccH0j2MN.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status