結果

問題 No.149 碁石の移動
ユーザー 小指が強い人小指が強い人
提出日時 2015-11-11 00:16:48
言語 Ruby
(3.2.2)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 11,212 KB
実行使用メモリ 15,304 KB
最終ジャッジ日時 2023-08-25 17:41:13
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,288 KB
testcase_01 AC 82 ms
15,052 KB
testcase_02 AC 82 ms
15,084 KB
testcase_03 AC 80 ms
15,108 KB
testcase_04 AC 84 ms
15,304 KB
testcase_05 AC 81 ms
15,112 KB
testcase_06 AC 82 ms
15,080 KB
testcase_07 AC 82 ms
15,264 KB
testcase_08 AC 81 ms
15,248 KB
testcase_09 AC 80 ms
15,092 KB
testcase_10 AC 82 ms
15,188 KB
testcase_11 AC 82 ms
15,188 KB
testcase_12 AC 82 ms
15,088 KB
testcase_13 AC 82 ms
15,240 KB
testcase_14 AC 82 ms
15,256 KB
testcase_15 AC 82 ms
15,048 KB
testcase_16 AC 81 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
c = gets.split.map(&:to_i)
if a[1] < c[0]
    a[0] -= c[0] - a[1]
    b[0] += c[0] - a[1]
end
if b[0] >= c[1]
    a[0] += c[1]
else
    a[0] += b[0]
end
puts a[0]
0