結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー mosmos_21mosmos_21
提出日時 2017-06-20 11:42:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 2,309 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 54,416 KB
最終ジャッジ日時 2024-04-10 02:17:42
合計ジャッジ時間 6,515 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 125 ms
53,940 KB
testcase_03 AC 123 ms
54,344 KB
testcase_04 WA -
testcase_05 AC 125 ms
54,148 KB
testcase_06 AC 122 ms
54,320 KB
testcase_07 AC 127 ms
54,204 KB
testcase_08 AC 126 ms
54,188 KB
testcase_09 AC 126 ms
53,960 KB
testcase_10 AC 132 ms
54,084 KB
testcase_11 AC 124 ms
54,056 KB
testcase_12 AC 124 ms
53,936 KB
testcase_13 AC 127 ms
53,932 KB
testcase_14 AC 125 ms
54,332 KB
testcase_15 AC 125 ms
54,068 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 124 ms
54,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int N = in.nextInt(), K = in.nextInt();
        if (K < 1 || N < K) {
            System.out.println(0);
        } else if (K == N / 2) {
            System.out.println(N - 1);
        } else {
            System.out.println(N - 2);
        }
    }
}
0