結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー msm10msm10
提出日時 2019-04-11 02:38:58
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 140 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 15,408 KB
最終ジャッジ日時 2023-09-22 23:58:20
合計ジャッジ時間 3,950 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,248 KB
testcase_01 AC 79 ms
15,080 KB
testcase_02 AC 81 ms
15,140 KB
testcase_03 AC 81 ms
15,100 KB
testcase_04 AC 81 ms
15,128 KB
testcase_05 AC 81 ms
15,288 KB
testcase_06 AC 80 ms
15,324 KB
testcase_07 AC 80 ms
15,128 KB
testcase_08 AC 81 ms
15,152 KB
testcase_09 AC 80 ms
15,280 KB
testcase_10 AC 81 ms
15,156 KB
testcase_11 AC 81 ms
15,288 KB
testcase_12 AC 81 ms
15,156 KB
testcase_13 AC 80 ms
15,092 KB
testcase_14 AC 79 ms
15,012 KB
testcase_15 AC 80 ms
15,356 KB
testcase_16 AC 80 ms
15,144 KB
testcase_17 AC 79 ms
15,304 KB
testcase_18 WA -
testcase_19 AC 79 ms
15,020 KB
testcase_20 WA -
testcase_21 AC 80 ms
15,264 KB
testcase_22 WA -
testcase_23 AC 79 ms
15,104 KB
testcase_24 WA -
testcase_25 AC 78 ms
15,304 KB
testcase_26 AC 80 ms
15,408 KB
testcase_27 AC 80 ms
15,304 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, K = gets.split(' ').map(&:to_i)

if K == 0 or K > N
  puts 0
elsif K * 2 + 1== N or N.even? or K.even?
  puts N - 2
else
  puts N - 1
end
0