Submission #805680

#TimeUsernameProblemLanguageResultExecution timeMemory
805680AlphaMale06Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; using ll = long long; using ld = long double; #define yes cout << "YES\n" #define no cout << "NO\n" #define F first #define S second #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define int long long char guess_first(){ int ans = press("AB"); if(ans==0){ ans=press("X"); if(ans==1){ return 'X'; } return 'Y'; } else{ ans=press("A"); if(ans==1){ return 'A'; } return 'B'; } } string guess_sequence(int n){ char f = guess_first(); vector<char> nf; if('A'!=f)nf.pb('A'); if('B'!=f)nf.pb('B'); if('X'!=f)nf.pb('X'); if('Y'!=f)nf.pb('Y'); int gsd=1; string ans= ""; ans+=f; while(gsd<n-1){ string gs=ans+nf[0]+nf[0]+ans+nf[0]+nf[1]+ans+nf[0]+nf[2]+ans+nf[1]+nf[0]; int kita=press(gs); if(kita==gsd-1){ ans.pop_back(); ans+=nf[1]; ans+=nf[0]; gsd++; } else if(kita==gsd){ gsd++; ans+=nf[2]; } else if(kita==gsd+1){ gsd++; ans+=nf[1]; } else{ gsd++; ans+=nf[0]; } } string gs=ans+nf[0]; if(press(gs)==n){ return gs; } else{ gs.pop_back(); gs+=nf[1]; if(press(gs)==n){ return gs; } else{ gs.pop_back(); return gs+nf[2]; } } }

Compilation message (stderr)

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