제출 #829349

#제출 시각아이디문제언어결과실행 시간메모리
829349iskhakkutbilim콤보 (IOI18_combo)C++14
100 / 100
28 ms520 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define ff first #define ss second #define all(a) a.begin(), a.end() /* int press(string s){ return 1; } */ string guess_sequence(int N){ string ans = ""; if(press("AB")){ if(press("A")) ans.push_back('A'); else ans.push_back('B'); }else{ if(press("X")) ans.push_back('X'); else ans.push_back('Y'); } if(N == 1) return ans; vector<char> chars; for(char ch : "ABXY"){ if(ch != ans[0]) chars.push_back(ch); } for(int i = 2;i < N; i++){ int same = press(ans + chars[0] + ans + chars[1] + chars[0] + ans + chars[1] + chars[1] + ans + chars[1] + chars[2]); if(same == i){ ans.push_back(chars[0]); }else if(same == i-1) ans.push_back(chars[2]); else ans.push_back(chars[1]); } if(press(ans + chars[0]) == N) ans+= chars[0]; else if(press(ans + chars[1]) == N) ans+= chars[1]; else ans+= chars[2]; return ans; } /* main(){ int n; cin >> n; cout << guess_sequence(n); return 0; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...