Submission #380908

#TimeUsernameProblemLanguageResultExecution timeMemory
380908ritul_kr_singhCombo (IOI18_combo)C++17
100 / 100
55 ms700 KiB
#include "combo.h" #include "bits/stdc++.h" using namespace std; string guess_sequence(int n){ string s; if(press("AB")) s = press("A") ? "A" : "B"; else s = press("X") ? "X" : "Y"; string all, orig = "ABXY"; if(n==1) return s; for(char c : orig) if(c!=s[0]) all.push_back(c); for(int i=1; i+1<n; ++i){ string t; for(char c : all) t+=(s + all[2]), t+=c; t+=s, t+=all[1]; s += all[press(t)-i]; } string t; if(press(s+all[0]+s+all[1])==n) s += (press(s+all[0])==n) ? all[0] : all[1]; else s += all[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...