Submission #615821

#TimeUsernameProblemLanguageResultExecution timeMemory
615821Minindu2006Combo (IOI18_combo)C++17
0 / 100
1 ms288 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int n) { vector<string> cc{"A", "B", "X", "Y"}; string ans; for(int i=0;i<3;i++) if(press(cc[i])) ans += cc[i]; if(ans.empty()) ans += cc[3]; vector<string> controls; for(int i=0;i<4;i++) { if(cc[i] != ans) controls.push_back(cc[i]); } if(n == 1) return ans; for(int i=0;i<n-1;i++) { int x = i + 2; int len = press(ans + controls[1] + ans + controls[0] + controls[0] + ans + controls[0] + controls[1] + ans + controls[0] + controls[2]); ans += controls[len - x]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...