Submission #1017125

#TimeUsernameProblemLanguageResultExecution timeMemory
1017125rakhim_ovaCombo (IOI18_combo)C++17
97 / 100
24 ms1992 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using ll = long long; char find_the_first_character(){ if(press("A")==1) return 'A'; if(press("B")==1) return 'B'; if(press("X")==1) return 'X'; return 'Y'; } string guess_sequence(int n) { char f=find_the_first_character(); string just="ABXY", abxy=""; string s=""; s+=f; for(auto c: just){ if(c==f) continue; abxy+=c; } int i=2; while(i<=n){ string s1=""; if(i+1<=n){ s1+=s+abxy[0]; s1+=s+abxy[1]+abxy[0]; s1+=s+abxy[1]+abxy[1]; s1+=s+abxy[1]+abxy[2]; int coins=press(s1); if(coins==i) s+=abxy[0]; else if(coins==i+1) s+=abxy[1]; else s+=abxy[2]; } else{ if(press(s+abxy[0])==i){ s+=abxy[0]; } else if(press(s+abxy[1])==i){ s+=abxy[1]; } else{ s+=abxy[2]; } } i++; } // cout << s << '\n'; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...