結果

問題 No.3112 Decrement or Mod Game
ユーザー よいちなすの
提出日時 2025-04-18 21:30:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 61,436 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-18 21:30:07
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 54 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

bool solve(long long a, long long b) {
    if (a == 0) return true;
    if (b == 0) return false;

    if (a >= b) {
        long long q = a / b;
        if (q >= 2) return true;
        return !solve(b, a % b);
    } else {
        return !solve(b, a - 1);
    }
}

int main() {
    long long A, B;
    cin >> A >> B;
    if (solve(A, B)) {
        cout << "Alice" << endl;
    } else {
        cout << "Bob" << endl;
    }
    return 0;
}
0