結果
問題 | No.2760 not fair position game |
ユーザー | uip-kleh |
提出日時 | 2024-05-21 16:19:25 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 3,690 bytes |
コンパイル時間 | 1,542 ms |
コンパイル使用メモリ | 177,636 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-05-21 16:19:28 |
合計ジャッジ時間 | 2,742 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,944 KB |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 1 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 2 ms
6,940 KB |
testcase_08 | AC | 1 ms
6,944 KB |
testcase_09 | AC | 2 ms
6,940 KB |
testcase_10 | AC | 2 ms
6,944 KB |
testcase_11 | AC | 2 ms
6,940 KB |
testcase_12 | AC | 2 ms
6,940 KB |
testcase_13 | AC | 2 ms
6,940 KB |
testcase_14 | AC | 1 ms
6,940 KB |
ソースコード
#include<bits/stdc++.h> #define all(v) begin(v), end(v) #define rall(v) rbegin(v), rend(v) #define uniq(v) sort(all(v));v.erase(unique(all(v)),end(v)) #define ll long long #define iv vector<ll> #define ivv vector<iv> #define ip pair<ll, ll> #define rep(i, n) for(ll i=0; i<(ll)n; i++) #define nrep(i, n) for(ll i=1; i<(ll)n+1; i++) #define rrep(i, n) for(ll i=n-1; i>=0; i--) #define MOD 998244353 #define INF 2e18 using namespace std; // USEFUL FUNCTION template<class T>bool chmax(T&a,const T&b){return (a<b)&&(a=b,true);} template<class T>bool chmin(T&a,const T&b){return (a>b)&&(a=b,true);} template<class T>void print(T&a){for(auto v: a) cout << v << ' '; cout << endl;} template<class T1, class T2>void printmp(map<T1, T2> &mp){for(auto iter: mp) cout << iter.first << ':' << iter.second << endl;} template<class T>using Greater_pq=priority_queue<T,vector<T>,greater<T>>; // NUMERIC FUNCTION ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} map<ll, ll> numeric_component(ll N) { map<ll, ll> res; for (ll i = 2; i * i <= N; i++) { if (N % i != 0) continue; while (N % i == 0) {res[i]++; N /= i;} } if (N != 1) res[N]++; return res; } // GRAPH FUNCTION struct UnionFind { iv par, rank, siz, min_node; UnionFind(int n) : par(n, -1), rank(n, 0), siz(n, 1) {} int root(int x) { if (par.at(x) == -1) return x; else return par.at(x) = root(par.at(x)); } bool is_same(int x, int y) {return root(x) == root(y);} bool unite(int x, int y) { int rx = root(x), ry = root(y); if (is_same(x, y)) return false; if (siz.at(rx) < siz.at(ry)) swap(rx, ry); par.at(ry) = rx; if (rank.at(rx) == rank.at(ry)) rank.at(rx) += 1; siz.at(rx) += siz.at(ry); return true; } }; // TREE FUNCTION template<class Monoid> struct SegTree { using Func = function<Monoid(Monoid, Monoid)>; // core member int N; Func OP; Monoid IDENTITY; // inner data int offset; vector<Monoid> dat; // constructor SegTree() {} SegTree(int n, const Func &op, const Monoid &identity) { init(n, op, identity); } SegTree(const vector<Monoid> &v, const Func &op, const Monoid &identity) { init((int)v.size(), op, identity); build(v); } void init(int n, const Func &op, const Monoid &identity) { N = n; OP = op; IDENTITY = identity; offset = 1; while (offset < N) offset *= 2; dat.assign(offset * 2, IDENTITY); } void init(const vector<Monoid> &v, const Func &op, const Monoid &identity) { init((int)v.size(), op, identity); build(v); } void build(const vector<Monoid> &v) { assert(N == (int)v.size()); for (int i = 0; i < N; ++i) dat[i + offset] = v[i]; for (int k = offset - 1; k > 0; --k) dat[k] = OP(dat[k*2], dat[k*2+1]); } int size() const { return N; } Monoid operator [] (int a) const { return dat[a + offset]; } // 以下省略 }; // MODINV ll modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } ll modfrac(ll a, ll b) { return (a%MOD) * modinv(b, MOD) % MOD; } // GRID iv di = {-1, 0, 0, 1}; iv dj = {0, -1, 1, 0}; iv di8 = {-1, -1, -1, 0, 0, 1, 1, 1}; iv dj8 = {-1, 0, 1, -1, 1, -1, 0, 1}; int main() { ll N, K; cin >> N >> K; if(N % 2 == 1) { cout << "Alice" << endl; } else { cout << "Bob" << endl; } }