# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313511 | 2020-10-16T06:35:04 Z | Jarif_Rahman | Combo (IOI18_combo) | C++17 | 0 ms | 0 KB |
#include "mycombo.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; str guess_sequence(int n){ str s = ""; int r = 0; while(n--){ int ab = press(s+"A"+s+"B"); int xy = press(s+"X"+s+"Y"); if(ab > r){ int a = press(s+"A"); int b = press(s+"B"); if(a > r){ s+="A"; r = a; continue; } if(b > r){ s+="B"; r = b; continue; } } if(xy > r){ int x = press(s+"X"); int y = press(s+"Y"); if(x > r){ s+="X"; r = x; continue; } if(y > r){ s+="Y"; r = y; continue; } } } return s; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout << guess_sequence(5) << "\n"; }