Submission #624605

#TimeUsernameProblemLanguageResultExecution timeMemory
624605SifferCombo (IOI18_combo)C++14
100 / 100
33 ms576 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s = ""; string c = ""; if(press("AB")) { if(press("A")) c = "BXY", s = "A"; else c = "AXY", s = "B"; } else { if(press("X")) c = "ABY", s = "X"; else c = "ABX", s = "Y"; } if(n == 1) return s; for(int i = 1; i < n-1; i++) { int k = press(s+c[0]+c[0]+s+c[0]+c[1]+s+c[0]+c[2]+s+c[1]); if(k == i+2) s += c[0]; if(k == i+1) s += c[1]; if(k == i) s += c[2]; } if(press(s+c[0]) == n) return s + c[0]; if(press(s+c[1]) == n) return s + c[1]; return s + c[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...