結果
問題 |
No.851 テストケース
|
ユーザー |
![]() |
提出日時 | 2019-07-26 21:25:02 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 786 bytes |
コンパイル時間 | 1,885 ms |
コンパイル使用メモリ | 77,264 KB |
実行使用メモリ | 50,780 KB |
最終ジャッジ日時 | 2024-07-02 06:35:03 |
合計ジャッジ時間 | 3,783 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 2 RE * 2 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int[] a = new int[n]; sa = br.readLine().split(" "); if (sa.length > 1) { System.out.println("assert"); return; } a[0] = Integer.parseInt(sa[0]); a[1] = Integer.parseInt(br.readLine()); a[2] = Integer.parseInt(br.readLine()); int[] b = new int[n]; b[0] = a[0] + a[1]; b[1] = a[0] + a[2]; b[2] = a[1] + a[2]; Arrays.parallelSort(b); if (b[1] == b[2]) { System.out.println(b[0]); } else { System.out.println(b[1]); } } }