Submission #415194

#TimeUsernameProblemLanguageResultExecution timeMemory
415194aris12345678Combo (IOI18_combo)C++14
97 / 100
45 ms568 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; const int mxN = 2005; string guess_sequence(int n) { string p = "", comb; if(press("A") == 1) p = "A", comb = "BXY"; else if(press("B") == 1) p = "B", comb = "AXY"; else if(press("X") == 1) p = "X", comb = "ABY"; else p = "Y", comb = "ABX"; if(n == 1) return p; for(int i = 2; i < n; i++) { int match = press(p+comb[0]+p+comb[1]+comb[0]+p+comb[1]+comb[1]+p+comb[1]+comb[2]); if(match == i-1) p += comb[2]; else if(match == i) p += comb[0]; else p += comb[1]; } if(press(p+comb[0]) == n) p += comb[0]; else if(press(p+comb[1]) == n) p += comb[1]; else p += comb[2]; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...