Submission #268600

#TimeUsernameProblemLanguageResultExecution timeMemory
268600wdjpngCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "combo.h" #define lint long long #define rep(i,n) for(int i = 0; i < n; i++) #define all(a) a.begin(), a.end() using namespace std; int press(string a){ cout << a <<"\n"; int res; cin>>res; return res; } string guess_sequence(int n){ string val = "ABXY"; string cur; if(press("AB")>=1){ if(press("A")){ cur="A"; } else { cur="B"; } } else { if(press("X")){ cur="X"; } else { cur="Y"; } } string valids=""; rep(i, 4){ if(val[i]==cur[0]){continue;} valids+=val[i]; } for(int i = 1; i<n-1; i++){ string newCur=""; rep(i, 3){ newCur+=cur+valids[0]+valids[i]; } newCur+=cur+valids[1]; int coins = press(newCur); if(coins==i+2){ cur+=valids[0]; } else if(coins == i+1){ cur+=valids[1]; } else { cur+=valids[2]; } } rep(i,3){ if(i==2||press(cur+valids[i])==n){cur+=valids[i];break;} } return cur; } signed main(){ int n; cin >> n; cout << guess_sequence(n); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccH9haut.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/ccpvrcyu.o:combo.cpp:(.text+0xc0): first defined here
/usr/bin/ld: /tmp/ccH9haut.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccpvrcyu.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status