Submission #394360

#TimeUsernameProblemLanguageResultExecution timeMemory
394360iulia13Combo (IOI18_combo)C++14
100 / 100
58 ms628 KiB
#include <iostream> #include "combo.h" using namespace std; char dani[4] = {'A', 'B', 'X', 'Y'}; string s; string guess_sequence(int n) { int i; if (press(s + dani[0] + dani[1]) > 0) { if (1 == press(s + dani[0])) { s += dani[0]; swap(dani[0], dani[3]); } else { s += dani[1]; swap(dani[1], dani[3]); } } else { if (1 == press(s + dani[2])) { s += dani[2]; swap(dani[2], dani[3]); } else s += dani[3]; } for (i = 2; i < n; i++) { int bebic = press(s + dani[0] + s + dani[1] + dani[0] + s + dani[1] + dani[2] + s + dani[1] + dani[1]); if (bebic == i - 1) s += dani[2]; else if (bebic == i) s += dani[0]; else s += dani[1]; } if (n == 1) return s; if (press(s + dani[0] + s + dani[1]) >= n) { if (n == press(s + dani[0])) s += dani[0]; else s += dani[1]; } else s += dani[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...