結果

問題 No.1748 Parking Lot
ユーザー ks2mks2m
提出日時 2021-11-19 21:53:47
言語 Java19
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 3,210 ms
コンパイル使用メモリ 71,664 KB
実行使用メモリ 57,484 KB
最終ジャッジ日時 2023-08-30 08:15:26
合計ジャッジ時間 6,853 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,428 KB
testcase_01 AC 124 ms
55,876 KB
testcase_02 AC 123 ms
55,936 KB
testcase_03 AC 124 ms
55,732 KB
testcase_04 AC 130 ms
57,484 KB
testcase_05 AC 126 ms
55,860 KB
testcase_06 AC 123 ms
55,572 KB
testcase_07 AC 122 ms
55,668 KB
testcase_08 AC 124 ms
55,860 KB
testcase_09 AC 125 ms
55,836 KB
testcase_10 AC 124 ms
55,852 KB
testcase_11 AC 126 ms
55,768 KB
testcase_12 AC 124 ms
55,432 KB
testcase_13 AC 125 ms
55,648 KB
testcase_14 AC 122 ms
55,596 KB
testcase_15 AC 124 ms
55,684 KB
testcase_16 AC 125 ms
55,748 KB
testcase_17 AC 123 ms
56,056 KB
testcase_18 AC 128 ms
55,716 KB
testcase_19 AC 123 ms
55,988 KB
testcase_20 AC 124 ms
55,720 KB
testcase_21 AC 122 ms
55,532 KB
testcase_22 AC 123 ms
55,448 KB
testcase_23 AC 122 ms
55,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.close();

		if (k == n - 1 || n == 1) {
			System.out.println(n);
		} else {
			System.out.println(n - 1);
		}
	}
}
0