結果

問題 No.1057 素敵な日
ユーザー tentententen
提出日時 2020-11-09 20:17:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 1,778 ms
コンパイル使用メモリ 73,064 KB
実行使用メモリ 56,608 KB
最終ジャッジ日時 2023-09-29 22:14:45
合計ジャッジ時間 3,583 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,840 KB
testcase_01 AC 117 ms
56,052 KB
testcase_02 AC 118 ms
56,144 KB
testcase_03 AC 118 ms
55,928 KB
testcase_04 AC 119 ms
56,064 KB
testcase_05 AC 117 ms
55,784 KB
testcase_06 AC 116 ms
56,132 KB
testcase_07 AC 116 ms
56,608 KB
testcase_08 AC 117 ms
56,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a == b) {
            System.out.println(a + b - 1);
        } else {
            System.out.println(Math.min(a, b) * 2);
        }
    }
}
0