Submission #596798

#TimeUsernameProblemLanguageResultExecution timeMemory
596798BelphegorCombo (IOI18_combo)C++14
0 / 100
1 ms208 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string C = "ABXY"; string guess_sequence(int n){ string s = "AB"; if(press(s)){ s = "A"; if(!press(s)) s = "B"; } else{ s = "X"; if(!press(s)) s = "Y"; } string S[3]; for(int i=0; i<3; i++) S[i] = s; string CC; for(int i=0; C[i]; i++) if(C[i]!=s[0]){ CC.push_back(C[i]); } for(int i=1; i<n; i++){ int score = S[0].length()*3; S[0].push_back(CC[0]); S[1].push_back(CC[0]); S[2].push_back(CC[1]); int nxt = press(S[0]+S[1]+S[2]); assert(score+3<=4*n); char ch; if(nxt==score) ch = CC[2]; else if(nxt==score+1) ch = CC[1]; else ch = CC[0]; for(int j=0; j<3; j++) S[j].back() = ch; } return S[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...