Submission #778694

#TimeUsernameProblemLanguageResultExecution timeMemory
778694Minindu206Combo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int n) { vector<string> cont; string seq; for (auto c : {"A", "B", "X", "Y"}) if (press(c)) { seq = c; break; } for (auto c : {"A", "B", "X", "Y"}) if (c != seq) cont.push_back(c); for (int i = 1; i < n - 1; i++) { string cpress = seq + cont[0] + seq + cont[1] + cont[0] + seq + cont[1] + cont[1] + seq + cont[1] + cont[2]; int cur = press(cpress) - i; if(cur == 1) seq += cont[0]; else if(cur == 2) seq += cont[1]; else seq += cont[2]; } for(auto c:cont) if(press(seq + c) == n) { seq += c; break; } return seq; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...