結果
問題 | No.2103 ±1s Game |
ユーザー |
![]() |
提出日時 | 2022-10-22 21:19:03 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 93 ms / 1,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 46 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-07-01 21:04:44 |
合計ジャッジ時間 | 4,768 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
コンパイルメッセージ
Main.rb:5: warning: assigned but unused variable - r Syntax OK
ソースコード
X, Y, K, P = gets.split.map(&:to_i)D = (X + Y) - Kif X <= D / 2r = Y - Kif K.even?if P == 1puts 'Alice'elseputs 'Bob'endelseif P == 1puts 'Bob'elseputs 'Alice'endendelsif Y <= D / 2if Y.even?if P == 1puts 'Alice'elseputs 'Bob'endelseif P == 1puts 'Alice'elseputs 'Bob'endendelseif D.even?puts 'Bob'elseputs 'Alice'endend