Submission #903891

#TimeUsernameProblemLanguageResultExecution timeMemory
903891zhasynCombo (IOI18_combo)C++14
0 / 100
1 ms352 KiB
#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 ans = ""; 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; } 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...