Submission #550480

#TimeUsernameProblemLanguageResultExecution timeMemory
550480AJ00Combo (IOI18_combo)C++14
100 / 100
29 ms628 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; int n; string guess_sequence(int N){ n = N; string ans; char temp; if (press("AB")){ temp = press("A") ? 'A' : 'B'; } else { temp = press("X") ? 'X' : 'Y'; } ans.push_back(temp); if (n == 1){ return ans; } // cout << ans << "\n"; vector<char> pos; if (temp != 'A'){ pos.push_back('A'); } if (temp != 'B'){ pos.push_back('B'); } if (temp != 'X'){ pos.push_back('X'); } if (temp != 'Y'){ pos.push_back('Y'); } for (int i = 1; i < n-1; i++){ string cur; for (int j = 0; j < 3; j++){ cur += ans+pos[0]+pos[j]; } cur += ans+pos[1]; int uwu = press(cur); //cout << cur << " " << uwu << " "; if (uwu == i+2){ ans.push_back(pos[0]); } if (uwu == i+1){ ans.push_back(pos[1]); } if (uwu == i){ ans.push_back(pos[2]); } //cout << ans << "\n"; } if (press(ans+pos[0]+ans+pos[1]) >= n){ temp = (press(ans+pos[0])>=n) ? pos[0] : pos[1]; } else { temp = pos[2]; } ans.push_back(temp); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...