結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー tazakkytazakky
提出日時 2017-09-15 15:11:28
言語 PHP
(8.3.4)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 1,848 ms
コンパイル使用メモリ 31,000 KB
実行使用メモリ 31,428 KB
最終ジャッジ日時 2024-04-25 11:30:17
合計ジャッジ時間 3,910 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
31,192 KB
testcase_01 AC 40 ms
31,144 KB
testcase_02 AC 40 ms
31,144 KB
testcase_03 AC 40 ms
31,256 KB
testcase_04 AC 42 ms
31,428 KB
testcase_05 AC 42 ms
31,348 KB
testcase_06 AC 40 ms
31,172 KB
testcase_07 AC 41 ms
31,024 KB
testcase_08 AC 40 ms
31,332 KB
testcase_09 AC 45 ms
31,380 KB
testcase_10 AC 40 ms
31,016 KB
testcase_11 AC 40 ms
31,196 KB
testcase_12 AC 41 ms
31,188 KB
testcase_13 AC 41 ms
31,020 KB
testcase_14 AC 41 ms
30,936 KB
testcase_15 AC 41 ms
30,948 KB
testcase_16 AC 40 ms
31,136 KB
testcase_17 AC 40 ms
31,148 KB
testcase_18 AC 41 ms
30,992 KB
testcase_19 AC 41 ms
31,288 KB
testcase_20 AC 40 ms
31,108 KB
testcase_21 AC 43 ms
31,204 KB
testcase_22 AC 41 ms
31,284 KB
testcase_23 AC 41 ms
31,212 KB
testcase_24 AC 41 ms
30,984 KB
testcase_25 AC 40 ms
30,992 KB
testcase_26 AC 41 ms
31,376 KB
testcase_27 AC 40 ms
31,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    list($n, $k) = explode(" ", trim(fgets(STDIN)));
    if($k == 0 || $k >$n){
        echo "0\n";
    }elseif($n % 2 == 1 && ceil($n / 2) == $k){
        echo ($n -1)."\n";
    }else{
        echo ($n -2)."\n";
    }
    

?>
0