# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
903897 | zhasyn | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 2 * 1e5 + 10, len = 316;
const ll mod = 1e9 + 7;
ll um(ll a, ll b){
return ((1LL * a * b) % mod + mod) % mod;
}
ll subr(ll a, ll b){
return ((1LL * a - b) % mod + mod) % mod;
}
string guess_sequence(int n){
string s = "ABXY";
int fir;
if(press("AB") >= 1){
if(press("A") == 1) fir = 0;
else fir = 1;
} else{
if(press("X") == 1) fir = 2;
else fir = 3;
}
string ans = s[fir];
for(int i = 1; i < n; i++){
int cnt = 0;
for(int j = 0; j < 4; j++){
if(j == fir) continue;
if(cnt == 2){
ans += s[j];
break;
}
int k = press(ans + s[j]);
cnt++;
if(k == i + 1){
ans += s[j];
break;
}
}
}
return ans;
}