Submission #971279

#TimeUsernameProblemLanguageResultExecution timeMemory
971279codefoxCombo (IOI18_combo)C++14
0 / 100
74 ms444 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; array<char, 4> arr = {'A', 'B', 'Y', 'X'}; string guess_sequence(int N) { char f = 'N'; for (int i = 0; i < 3; i++) { string st = ""; st += arr[i]; if (press(st)) { f = arr[i]; break; } } if (f=='N') f = 'X'; string s = ""; s += f; for (int i = 1; i < N; i++) { if (f == 'A') s+='B'; else s+='A'; } int j = press(s); while (j != N) { string ss= ""; for (int i = 0; i < N; i++) { if (i < j) ss+=s[i]; else if (i==j && f != 'X') ss+='X'; else if (i==j && f=='X') ss+='Y'; else if (f =='A') ss+='B'; else ss += 'A'; } int nj = press(ss); if (nj==j) { if (f == 'X' || f == 'Y') ss[nj] = 'B'; else ss[nj] = 'Y'; nj++; } s = ss; j=nj; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...