Submission #204552

#TimeUsernameProblemLanguageResultExecution timeMemory
204552medkCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" #define pb push_back #define ll long long #define x first #define y second using namespace std; string guess_sequence(int n) { string ret=""; string c[3]; int gt=press("AB"); if(gt) { gt=press("A"); if(gt) ret+="A", c[0]="B", c[1]="X", c[2]="Y"; else ret+="B", c[0]="A", c[1]="X", c[2]="Y"; } else { gt=press("X"); if(gt) ret+="X", c[0]="A", c[1]="B", c[2]="Y"; else ret+="Y", c[0]="A", c[1]="X", c[2]="B"; } if(n==1) return ret; for(int i=1;i<n;i++) { gt=press(ret+c[0]+c[0]+ret+c[0]+c[1]+ret+c[0]+c[2]+ret+c[1]); if(gt==i) ret+=c[2]; else if(gt==i+1) ret+=c[1]; else ret+=c[0]; } gt=press(ret+c[0]); if(gt==n) return ret+c[0]; else { gt=press(ret+c[1]); if(gt==n) return ret+c[1]; return ret+c[2]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...