結果

問題 No.1748 Parking Lot
ユーザー merlinmerlin
提出日時 2021-11-19 21:50:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 2,281 ms
コンパイル使用メモリ 72,092 KB
実行使用メモリ 49,604 KB
最終ジャッジ日時 2023-08-30 08:07:59
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,280 KB
testcase_01 AC 44 ms
49,284 KB
testcase_02 AC 43 ms
49,228 KB
testcase_03 AC 43 ms
49,296 KB
testcase_04 AC 43 ms
49,288 KB
testcase_05 AC 43 ms
49,400 KB
testcase_06 AC 45 ms
49,292 KB
testcase_07 AC 44 ms
49,312 KB
testcase_08 AC 43 ms
49,088 KB
testcase_09 AC 44 ms
49,304 KB
testcase_10 AC 44 ms
49,552 KB
testcase_11 AC 44 ms
49,172 KB
testcase_12 AC 44 ms
47,700 KB
testcase_13 AC 44 ms
49,252 KB
testcase_14 AC 43 ms
47,304 KB
testcase_15 AC 43 ms
49,248 KB
testcase_16 AC 44 ms
49,356 KB
testcase_17 AC 42 ms
49,252 KB
testcase_18 AC 43 ms
49,304 KB
testcase_19 AC 43 ms
49,604 KB
testcase_20 AC 44 ms
49,092 KB
testcase_21 AC 44 ms
49,448 KB
testcase_22 AC 44 ms
49,252 KB
testcase_23 AC 44 ms
49,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int n=Integer.parseInt(s[0]),k=Integer.parseInt(s[1]);
        int ans=n;
        if(n-1>k) ans=n-1;
        else if(k-1>0 && n-1<k) ans=k-1;
        System.out.println(ans);
    }
}
0