結果

問題 No.2103 ±1s Game
ユーザー baLoon8128baLoon8128
提出日時 2022-10-21 21:48:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,042 bytes
コンパイル時間 3,819 ms
コンパイル使用メモリ 228,036 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 06:24:38
合計ジャッジ時間 4,894 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repr(i, n) for (int i = (int)(n - 1); i >= 0; --i)

bool solve() {
    int x, y, K, p;
    cin >> x >> y >> K >> p;
    int r = x + y - K;
    if (r & 1) {
        if (x <= r / 2) {
            if (K & 1) {
                if (p == 1) return false;
            } else {
                if (p == -1) return false;
            }
        }
        if (y <= r / 2 && p == -1) return false;
        return true;
    } else {
        if (x <= r / 2) {
            if (K & 1) {
                if (p == -1) return true;
            } else {
                if (p == 1) return true;
            }
        }
        if (y <= r / 2 && p == 1) return true;
        return false;
    }
}
int main() {
    cout << (solve() ? "Alice" : "Bob") << '\n';
    return 0;
}
0