Submission #600097

#TimeUsernameProblemLanguageResultExecution timeMemory
600097FidanCombo (IOI18_combo)C++17
0 / 100
1 ms284 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; typedef int ll; vector<char> v(3); string guess_sequence(int N) { ll k=press("AB"); string s; if(k==0){ k=press("X"); v[0]='A', v[1]='B'; if(k==0){ v[2]='Y'; s="X"; } else{ v[2]='X'; s="Y"; } } else { k=press("A"); v[1]='X', v[2]='Y'; if(k==1){ v[0]='B'; s="A"; } else{ v[0]='A'; s="B"; } } ll l=1, a; while(l<N){ l++; s+=v[0]; a=press(s); if(a==l) continue; s.pop_back(); s+=v[1]; a=press(s); if(a==l) continue; s.pop_back(); s+=v[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...