結果

問題 No.3112 Decrement or Mod Game
ユーザー Naru820
提出日時 2025-08-11 13:44:15
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 3,554 ms
コンパイル使用メモリ 272,392 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-08-11 13:44:22
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 43 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

// by GPT-5
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int64 A, B;
    cin >> A >> B;

    bool aliceTurn = true; // true: Alice, false: Bob
    while (true) {
        if (B > A) swap(A, B);
        if (B == 0) {
            cout << (aliceTurn ? "Bob" : "Alice") << "\n";
            return 0;
        }
        if (A % B == 0 || A / B >= 2) {
            cout << (aliceTurn ? "Alice" : "Bob") << "\n";
            return 0;
        }
        A %= B;
        aliceTurn = !aliceTurn;
    }
}
0