結果
問題 |
No.851 テストケース
|
ユーザー |
![]() |
提出日時 | 2021-02-09 08:07:02 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 746 bytes |
コンパイル時間 | 2,319 ms |
コンパイル使用メモリ | 75,516 KB |
実行使用メモリ | 54,008 KB |
最終ジャッジ日時 | 2024-07-06 13:36:38 |
合計ジャッジ時間 | 4,848 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
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\""); } } }