제출 #380908

#제출 시각아이디문제언어결과실행 시간메모리
380908ritul_kr_singh콤보 (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...