結果

問題 No.2175 Exciting Combo
ユーザー tk55513tk55513
提出日時 2023-02-17 19:13:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 3,252 ms
コンパイル使用メモリ 83,740 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-09-26 16:55:53
合計ジャッジ時間 5,049 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
55,812 KB
testcase_01 AC 132 ms
55,540 KB
testcase_02 AC 137 ms
55,788 KB
testcase_03 AC 132 ms
55,996 KB
testcase_04 AC 129 ms
55,936 KB
testcase_05 AC 133 ms
56,076 KB
testcase_06 AC 131 ms
56,128 KB
testcase_07 AC 130 ms
55,920 KB
testcase_08 AC 131 ms
56,032 KB
testcase_09 AC 132 ms
56,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner sc=new Scanner(System.in);
        List<Integer> lst = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            lst.add(sc.nextInt());
        }
        int max=lst.stream().mapToInt(i->i).max().orElseThrow();
        int sum=lst.stream().mapToInt(i->i).sum();
        int b=sc.nextInt();
        System.out.println(Math.max(max*3,sum+b));

    }
}
0