Submission #110882

#TimeUsernameProblemLanguageResultExecution timeMemory
110882MercenaryCombo (IOI18_combo)C++14
100 / 100
73 ms992 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string can = "ABXY"; char first; string res = ""; if(press("AB")){ if(press("A") == 1){ first = 'A'; } else { first = 'B'; } }else{ if(press("X") == 1){ first = 'X'; }else{ first = 'Y'; } } // cout << first << endl; res += first; if(N == 1)return res; can.erase(can.find(first),1); // for(char c : can)cout << c << endl; for(int i = 2 ; i < N ; ++i){ int Now = press(res + can[0] + res + can[1] + can[0] + res + can[1] + can[1] + res + can[1] + can[2]); if(Now == i - 1){ res += can[2]; }else if(Now == i){ res += can[0]; }else if(Now == i + 1)res += can[1]; else assert(0); } if(press(res + can[0]) == N)res += can[0]; else if(press(res + can[1]) == N)res += can[1]; else res += can[2]; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...