제출 #550479

#제출 시각아이디문제언어결과실행 시간메모리
550479AJ00콤보 (IOI18_combo)C++14
5 / 100
1 ms268 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); // 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...