Submission #1161533

#TimeUsernameProblemLanguageResultExecution timeMemory
1161533JahonaliXCombo (IOI18_combo)C++20
100 / 100
8 ms492 KiB
#include <bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int n) { string a = ""; vector<string> s{"A", "B", "X", "Y"}; if (press("AB")) { if (press("A")) a += "A"; else a += "B"; } else { if (press("X")) a += "X"; else a += "Y"; } s.erase(find(s.begin(), s.end(), a)); for (int i = 2; i < n; ++i) { int x = press(a + s[0] + a + s[1] + s[0] + a + s[1] + s[1] + a + s[1] + s[2]); if (x == a.size()) a += s[2]; else if (x == a.size() + 1) a += s[0]; else a += s[1]; } if (n > 1) { if (press(a + s[0]) > a.size()) a += s[0]; else if (press(a + s[1]) > a.size()) a += s[1]; else a += s[2]; } return a; };
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...