1919A - Wallet Exchange - CodeForces Solution


games math *800

Please click on ads to support us..

C++ Code:

#pragma GCC optimize("Ofast")

#include "bits/stdc++.h"

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<string, int>> vps;
typedef vector<vector<ll>> vvll;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<ld, ld> pld;
typedef pair<ll, ll> pll;

#define minrep(x) x.resize(unique(x.begin(), x.end()) - x.begin());
#define rast(x1, y1, x2, y2) sqrtf((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
#define rev(x) reverse(x.begin(), x.end())
#define sortdown(x) sort(x.rbegin(), x.rend())
#define sortup(x) sort(x.begin(), x.end())
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pb(x) push_back(x)

#define forik(fqf, n) for (ll i = fqf; i < n; i++)
#define forik2(fqfqf, n) for (ll j = fqfqf; j < n; j++)
#define forik3(fqfqfq, n) for (ll t = fqfqfq; t < n; t++)

#define fi first
#define all(x) x.begin(), x.end()
#define se second
#define ln "\n"
#define ts(x) to_string(x)
#define ll0 ll(0)
#define re return

#define rep(i, a, n) for (ll   i = a; i < ll(n); ++i)

#ifdef OG_Sergzhik2
bool local = true;
#else
bool local = false;
#endif
const ll INF = 1e9;

double getTime() {
    return clock() / (double) CLOCKS_PER_SEC;
}

ll binpow(ll a, ll n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return binpow(a, n - 1) * a;
    else {
        ll b = binpow(a, n / 2);
        return b * b;
    }
}

vector<char> kl = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
                   'u', 'v', 'w', 'x', 'y', 'z'};
vector<char> kl2 = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
                    'U', 'V', 'W', 'X', 'Y', 'Z'};

template<typename T>
istream &operator>>(istream &in, vector<T> &a) {
    for (T &i: a) in >> i;
    return in;
}

vector<long long> prefix(vector<ll> vec) {
    int n = (int) vec.size();
    vector<long long> ans(n);
    ans[0] = vec[0];
    for (int i = 1; i < n; i++) {

    }
    return ans;
}

int NOD(ll a, ll b) {
    while (a > 0 && b > 0) {
        if (a > b) {
            a %= b;
        } else {
            b %= a;
        }
    }
    return a + b;
}

bool binsearsh(vll &ms, ll a, ll n) {
    ll l = 0, r = n;
    while (l + 1 < r) {
        ll m = (l + r) / 2;
        if (ms[m] <= a) {
            l = m;
        } else {
            r = m;
        }
    }
    return (ms[l] == a);
}

void calc(ll n, vll d) {
    for (ll i = 2; i <= n; i++) {
        if (d[i] == 0) {
            for (ll j = i + i; j <= n; j += i) {
                d[j] = i;
            }
        }
    }
}

ll resheto(ll n, vll m) {
    for (ll i = 2; i < n + 1; i++) {
        for (ll j = i * i; j < n + 1; j += i) {
            m[j - 1] = 0;
        }

    }
    forik(0, n) {
        if (m[i] == n) {
            re 1;
        }
    }
    re 0;
}

bool checkProst(ll n) {
    if (n == 1) {
        re 0;
    }
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            re 0;
        }
    }
    re 1;
}

void bfs(ll x, vvll &g, vll &vis, vll &d, ll s) {
    queue<ll> q;
    d[x] = 0;
    q.push(x);
    while (!q.empty()) {
        x = q.front();
        q.pop();
        for (ll y: g[x]) {
            if (d[y] == -1) {
                d[y] = d[x] + 1;
                q.push(y);
            }
        }
    }
}

void dfs(ll v, vvll &g, vll &vis) {
    vis[v] = 1;
    for (ll to: g[v])
        if (vis[to] != 1)
            dfs(to, g, vis);
}

void solves();

/*					                        ____
========================================== /  __| ==========================================
========================================== \__ \  ==========================================
========================================== __|  | ==========================================
========================================== |___/  ==========================================
																						  */


int main() {
    ios::sync_with_stdio(0);
    if (local) {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
    ll T = 1;
    cin >> T;
    while (T--) {
        //cout<<12-T<<";";
        solves();
        cout << endl;
    }
    if (local) {
        //cout.precision(32);
        cout << endl << fixed << "time = " << getTime();
    }
}

void solves() {
    ll a,b;
    cin>>a>>b;
    if((a+b)%2==0){
        cout<<"Bob"; re;
    }
    else{
        cout<<"Alice";re;
    }

}


Comments

Submit
0 Comments
More Questions

1717D - Madoka and The Corruption Scheme
1296D - Fight with Monsters
729D - Sea Battle
788A - Functions again
1245B - Restricted RPS
1490D - Permutation Transformation
1087B - Div Times Mod
1213B - Bad Prices
1726B - Mainak and Interesting Sequence
1726D - Edge Split
1726C - Jatayu's Balanced Bracket Sequence
1726A - Mainak and Array
1613C - Poisoned Dagger
475B - Strongly Connected City
652B - z-sort
124B - Permutations
1496C - Diamond Miner
680B - Bear and Finding Criminals
1036E - Covered Points
1015D - Walking Between Houses
155B - Combination
1531A - Зингер | color
1678A - Tokitsukaze and All Zero Sequence
896A - Nephren gives a riddle
761A - Dasha and Stairs
1728B - Best Permutation
1728A - Colored Balls Revisited
276B - Little Girl and Game
1181A - Chunga-Changa
1728C - Digital Logarithm