Submission #204549

#TimeUsernameProblemLanguageResultExecution timeMemory
204549medkCombo (IOI18_combo)C++14
0 / 100
2 ms204 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=""; int gt=press("AB"); if(gt) { gt=press("A"); if(gt) ret+="A", c="BXY"; else ret+="B", c="AXY"; } else { gt=press("X"); if(gt) ret+="X", c="ABY"; else ret+="Y", c="ABX"; } 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...