結果

問題 No.851 テストケース
ユーザー ks2mks2m
提出日時 2019-07-26 21:30:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 2,217 ms
コンパイル使用メモリ 74,192 KB
実行使用メモリ 50,272 KB
最終ジャッジ日時 2023-09-15 00:37:58
合計ジャッジ時間 4,315 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
49,812 KB
testcase_01 AC 46 ms
49,804 KB
testcase_02 WA -
testcase_03 AC 45 ms
49,868 KB
testcase_04 AC 45 ms
49,784 KB
testcase_05 AC 45 ms
49,648 KB
testcase_06 AC 46 ms
50,188 KB
testcase_07 AC 46 ms
49,960 KB
testcase_08 AC 47 ms
49,796 KB
testcase_09 AC 46 ms
49,812 KB
testcase_10 AC 46 ms
49,840 KB
testcase_11 AC 46 ms
49,772 KB
testcase_12 AC 46 ms
50,272 KB
testcase_13 AC 45 ms
49,636 KB
testcase_14 AC 46 ms
49,732 KB
testcase_15 AC 45 ms
49,776 KB
testcase_16 AC 46 ms
49,576 KB
testcase_17 AC 46 ms
49,964 KB
testcase_18 AC 47 ms
49,628 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 47 ms
50,160 KB
testcase_22 AC 47 ms
50,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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]);
		long[] a = new long[n];
		sa = br.readLine().split(" ");
		if (sa.length > 1) {
			System.out.println("assert");
			return;
		}
		a[0] = Long.parseLong(sa[0]);
		a[1] = Long.parseLong(br.readLine());
		a[2] = Long.parseLong(br.readLine());

		long[] b = new long[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]);
		}
	}
}
0