Submission #215003

#TimeUsernameProblemLanguageResultExecution timeMemory
215003tushar_2658Combo (IOI18_combo)C++14
10 / 100
113 ms468 KiB
#include "combo.h" #include "bits/stdc++.h" using namespace std; string guess_sequence(int N) { string ans; ans ="A"; int tot = press(ans); if(tot != 1){ ans = "B"; tot = press(ans); } if(tot != 1){ ans = 'X'; tot = press(ans); } if(tot != 1){ ans = "Y"; tot = press(ans); } string ss = "ABXY"; for(int i = 1; i < N; i++){ int need = tot + 1; for(int j = 0; j < 4; j++){ if(j == 0){ ans += ss[j]; tot = press(ans); }else if(j > 0){ ans[i] = ss[j]; tot = press(ans); } if(tot == need)break; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...