Submission #167136

#TimeUsernameProblemLanguageResultExecution timeMemory
167136minseo852Combo (IOI18_combo)C++11
100 / 100
103 ms572 KiB
#include <combo.h> #include<string> #include <vector> using namespace std; #define t press string guess_sequence(int N) { std::string r, p, o = "ABXY"; int i, j, c; r = t("AB") ? t("A") ? "A" : "B" : t("X") ? "X" : "Y"; if(N==1)return r; for (i = 0; i < 4; i++)if (o[i] == r[0]){ o.erase(o.begin() + i); break; } for (int i = 1; i < N - 1; i++) { p=r+o[0];for(j=0;j<3;){p+=r+o[1]+o[j++];} c = t(p); if (c == i) r += o[2]; else if (c == i + 1) r += o[0]; else r += o[1]; } r+=o[t(r+o[0]+r+o[1])==N?t(r+o[0])==N?0:1:2]; return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...