Submission #133804

#TimeUsernameProblemLanguageResultExecution timeMemory
133804shafinalamCombo (IOI18_combo)C++14
5 / 100
83 ms612 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; vector<char>t{'A', 'B', 'X', 'Y'}; string guess_sequence(int N) { string ans, p; p = "AB"; if(press(p)>=1) { p = "A"; if(press(p)==1) ans = "A"; else ans = "B"; } else { p = "X"; if(press(p)==1) ans = "X"; else ans = "Y"; } if(N==1) return ans; for(int i = 0; i < 4; i++) { if(t[i]==ans[0]) { t.erase(t.begin()+i); break; } } for(int i = 2; i < N; i++) { p = ans+t[0]; for(auto c : t) { p+=ans+t[1]+c; } int coins = press(p); int n = ans.size(); if(coins==n) ans+=t[2]; else if(coins==n+1) ans+=t[0]; else ans+=t[1]; } if(press(ans+t[0])==N) ans+=t[0]; else if(press(ans+t[1])==N) ans+=t[1]; else ans+=t[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...