Submission #170093

#TimeUsernameProblemLanguageResultExecution timeMemory
170093buttercrabCombo (IOI18_combo)C++17
100 / 100
41 ms532 KiB
#include "combo.h" using namespace std; string guess_sequence(int n) { string s, t; if (press("AB")) { if (press("A")) t = "BXY", s = "A"; else t = "AXY", s = "B"; } else { if (press("X")) t = "ABY", s = "X"; else t = "ABX", s = "Y"; } for (int i = 1; i < n - 1; i++) { s += t[press(s + t[1] + s + t[2] + t[0] + s + t[2] + t[1] + s + t[2] + t[2]) - s.size()]; } if(n == 1) return s; if(press(s + t[0]) == n) return s + t[0]; if(press(s + t[1]) == n) return s + t[1]; return s + t[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...