Submission #668703

#TimeUsernameProblemLanguageResultExecution timeMemory
668703mseebacherCombo (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include <iostream> using namespace std; int press(string p); string guess_sequence(int N){ int maxi = 0; string arr[4]; arr[0] = "A"; arr[1] = "B"; arr[2] = "X"; arr[3] = "Y"; string ans = ""; for(int i = 0;i<3;i++){ if(press(arr[i]) > maxi){ maxi = 1; ans += arr[i]; break; } } if(ans == ""){ ans = arr[3]; maxi = 1; } string neu[3]; int ptr = 0; for(int i = 0;i<4;i++){ if(arr[i] != ans){ neu[ptr] = arr[i]; ptr++; } } for(int i = 1;i<N;i++){ for(int j = 0;j<2;j++){ string temp = ans+neu[j]; if(press(temp) > maxi){ maxi++; ans = temp; break; } } if(maxi != i-1){ ans += neu[2]; maxi++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...