Submission #366611

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