結果

問題 No.3112 Decrement or Mod Game
コンテスト
ユーザー you_phys
提出日時 2026-07-19 01:56:30
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 322 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,436 ms
コンパイル使用メモリ 182,308 KB
実行使用メモリ 9,412 KB
最終ジャッジ日時 2026-07-19 01:56:44
合計ジャッジ時間 4,475 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 43 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

bool win(long long a, long long b){
    if(a < b) swap(a, b);

    if(a == b) return false;

    if(a >= 2 * b) return true;

    return !win(b, a - b);
}
int main(){
  ll A,B;
  cin >> A >> B;
  if(win(A, B)) cout << "Alice\n";
  else cout << "Bob\n";
}
0