Submission #75958

#TimeUsernameProblemLanguageResultExecution timeMemory
75958someone_aaCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
//#include "combo.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int press(string a) { int answ; cin>>answ; return answ; } std::string guess_sequence(int N) { std::string p = ""; if(press("AB") >= 1) { if(press("A") == 1) p += "A"; else p += "B"; } else { if(press("X") == 1) p += "X"; else p += "Y"; } vector<char> letters; if(p[0] != 'A') letters.pb('A'); if(p[0] != 'B') letters.pb('B'); if(p[0] != 'X') letters.pb('X'); if(p[0] != 'Y') letters.pb('Y'); for(int i=2;i<=N;i++) { if(i < N) { string temp = p + letters[0] + letters[0]; string temp2 = p + letters[0] + letters[1]; string temp3 = p + letters[0] + letters[2]; string temp4 = p + letters[1]; string t = temp + temp2 + temp3 + temp4; int x = press(t); if(x == i) p += letters[1]; else if(x > i) p += letters[0]; else p += letters[2]; } else { if(press(p + letters[0]) == N) p += letters[0]; else if(press(p + letters[1]) == N) p += letters[1]; else p += letters[2]; } } return p; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccCSWJRL.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/ccD0rCoK.o:combo.cpp:(.text+0xc0): first defined here
collect2: error: ld returned 1 exit status