제출 #937007

#제출 시각아이디문제언어결과실행 시간메모리
937007Yazan_SA콤보 (IOI18_combo)C++14
0 / 100
1 ms596 KiB
#include<bits/stdc++.h> #include<combo.h> using namespace std; //int press(string p) //{ // //} string guess_sequence(int N) { string ans=""; string bts="ABXY"; int mx=0,mxp=0; while(mx!=N) { if(ans!="" && (int)bts.size()==4) { bts = ""; if (ans[0] != 'A') { bts.push_back('A'); } if (ans[0] != 'B') { bts.push_back('B'); } if (ans[0] != 'X') { bts.push_back('X'); } if (ans[0] != 'Y') { bts.push_back('Y'); } } mx=press(ans+bts[0]+ans+bts[1]); if(mx>mxp) { if(mx-2==mxp)ans+=bts[0]; else{ if(mx==press(ans+bts[0]))ans+=bts[0]; else ans+=bts[1]; } } else if(ans=="") { if(mxp+1==press(ans+bts[2]))ans+=bts[2]; else ans+=bts[3]; } else ans+=bts[2]; mxp=ans.size(); } return ans; } //int main() //{ // string s="abcd"; // s.erase(s.begin()+s.find('a')); // cout<<s; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...