Submission #197708

#TimeUsernameProblemLanguageResultExecution timeMemory
197708kshitij_sodaniCombo (IOI18_combo)C++17
5 / 100
2 ms272 KiB
#include <iostream> #include <bits/stdc++.h> #include "combo.h" using namespace std; typedef long long int llo; #define mp make_pair #define pb push_back string guess_sequence(int n){ string s=""; int aa; aa=press(s+"A"); if(aa==1){ s+="A";} else{ aa=press(s+"B"); if(aa==1){ s+="B"; } else{ aa=press(s+"X"); if(aa==1){ s+="X"; } else{ s+="Y"; } } } string b="B"; string x="X"; string y="Y"; if(s=="B"){ b="A"; } else if(s=="X"){ x="A"; } else if(s=="Y"){ y="A"; } for(int co=1;co<n-1;co++){ aa=press(s+b+s+x+y+s+x+x+s+x+b); if(aa==co){ s+=y; } else if(aa==co+1){ s+=b; } else{ s+=x; } } aa=press(s+b); if(aa==n){ s+=b; } else{ aa=press(s+x); if(aa==n){ s+=x; } else{ s+=y; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...