結果

問題 No.851 テストケース
ユーザー tentententen
提出日時 2021-02-09 08:07:02
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 746 bytes
コンパイル時間 2,319 ms
コンパイル使用メモリ 74,032 KB
実行使用メモリ 57,824 KB
最終ジャッジ日時 2023-09-20 18:43:29
合計ジャッジ時間 6,646 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,648 KB
testcase_01 AC 128 ms
56,008 KB
testcase_02 AC 125 ms
55,664 KB
testcase_03 AC 126 ms
55,864 KB
testcase_04 AC 125 ms
56,016 KB
testcase_05 AC 130 ms
55,728 KB
testcase_06 AC 126 ms
55,772 KB
testcase_07 AC 123 ms
55,396 KB
testcase_08 AC 125 ms
57,824 KB
testcase_09 AC 128 ms
55,820 KB
testcase_10 AC 126 ms
55,668 KB
testcase_11 AC 128 ms
55,496 KB
testcase_12 AC 126 ms
55,500 KB
testcase_13 AC 124 ms
55,460 KB
testcase_14 AC 125 ms
55,676 KB
testcase_15 AC 126 ms
55,832 KB
testcase_16 AC 124 ms
55,664 KB
testcase_17 AC 124 ms
55,932 KB
testcase_18 AC 125 ms
55,856 KB
testcase_19 AC 126 ms
55,672 KB
testcase_20 AC 123 ms
55,912 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            Integer.parseInt(sc.nextLine());
            int[] arr = new int[3];
            for (int i = 0; i < 3; i++) {
                arr[i] = Integer.parseInt(sc.nextLine());
            }
            TreeSet<Integer> sums = new TreeSet<>();
            for (int i = 0; i < 2; i++) {
                for (int j = i + 1; j < 3; j++) {
                    sums.add(arr[i] + arr[j]);
                }
            }
            sums.pollLast();
            System.out.println(sums.last());
            
        } catch (Exception e) {
            System.out.println("\"assert\"");
        }
    }
}
0