結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー バカらっく
提出日時 2018-03-03 22:23:55
言語 Swift
(6.0.3)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 129,140 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-11-30 12:06:51
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

let inpt = readLine()!.split(separator: " ").map({Int($0)!})

if inpt[1] > inpt[0] || inpt[1] <= 0 {
    print(0)
} else {
    if(inpt[0] % 2 != 0 && inpt[0] / 2 + 1 == inpt[1]) {
        print(inpt[0]-1)
    } else {
        print(inpt[0]-2)
    }
}
0