Submission #1148064

#TimeUsernameProblemLanguageResultExecution timeMemory
1148064guymmkCombo (IOI18_combo)C++20
10 / 100
27 ms23940 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include "combo.h"
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("O3,Ofast,unroll-loops")
//#pragma GCC target("popcnt")
//#define int long long
#define ll long long
#define ld long double
#define endl '\n'
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define debug(...) printf(__VA_ARGS__)
//#define debug(...)
#define trace(x) cout<<#x<<"="<<x<<endl;
//#define trace(x)
#define vi vector<int>
#define popcnt(x) (int)__builtin_popcountll(x)
#define vpii vector<pii >
#define vaii vector<array<int,2>>
#define vvi vector<vector<int> >
#define umap unordered_map
#define uset unordered_set
#define mk make_pair
#define pb push_back
#define pob pop_back
#define _ <<' '<<
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define read(x) for (auto& zu: (x)) cin >> zu;
#define write(x) for (auto& zu: (x))cout << zu<<' '; cout<<endl;
static inline void print(const int &x) {
    if (x > 9)print(x / 10);
    putchar('0' + x % 10);
}
//template<typename... T>void read(T&... args) {((for (auto &zu: (args)) { cin >> zu; }),...);}
#define F first
#define S second
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define mustawa ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie();
#define saudi main
const int inf=1e9+7;
void fa(bool ok){ cout << (ok ? "YES": "NO") << endl;}
int pw(ll a, ll b, ll mod= 1e9 + 7){
    a %= mod;
    ll res = 1;
    while (b > 0) {
        if (b&1) {
            res = res * a%mod;
        }b /= 2;
        a = a * a%mod;
    }
    return res;
}int pwnomod(ll a, ll b){
    ll res = 1;
    while (b > 0) {
        if (b&1) {
            res = res * a;
        }b /= 2;
        a = a * a;
    }
    return res;
}
inline void usaco(string s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}inline void usaco(string s1,string s2) {
    freopen((s1 + ".txt").c_str(), "r", stdin);
    freopen((s2 + ".txt").c_str(), "w", stdout);
    freopen("err.txt", "w", stderr);
}int inve(int x,int mod=inf){
    return pow(x,mod-2);
}
int gcd(int a,int b){
    if (b == 0)return a;
    return gcd(b, a % b);
}

int lcm(int a, int b){
    return (a / gcd(a, b)) * b;
}
//long double log(int base,int x){
//    return log2(x)/log(base);
//}
int log(int base,int x){
    return (int)(log2(x)/log2(base));
}
int sum(int l,int r) {
    if (l > r)swap(l, r);
    int a = (l - 1) * l / 2;
    int b = r * (r + 1) / 2;
    return b - a;
}
const int N=1e6+7;
vi adj[N];
int dp[N];
bool vis[N];
string guess_sequence(int n){
    string s="ABXY",ret;
    if(press("A"))s="BXY",ret+="A";
    else if(press("B"))s="AXY",ret+="B";
    else if(press("X"))s="ABY",ret+="X";
    else if(press("Y"))s="ABX",ret+="Y";
    int cur=1;
    for(int i=1;i<n;i++){
        for(auto i:s){
            string temp=ret+i;
            int p=press(temp);
            if(p>cur){
                cur=p;
                ret=temp;
                break;
            }
        }
    }return ret;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...