結果

問題 No.851 テストケース
ユーザー ks2mks2m
提出日時 2019-07-26 21:28:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 790 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 75,328 KB
実行使用メモリ 50,180 KB
最終ジャッジ日時 2023-09-15 00:35:09
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
50,044 KB
testcase_01 AC 45 ms
49,720 KB
testcase_02 WA -
testcase_03 AC 45 ms
49,860 KB
testcase_04 AC 44 ms
50,180 KB
testcase_05 AC 46 ms
49,840 KB
testcase_06 AC 45 ms
49,804 KB
testcase_07 AC 44 ms
47,804 KB
testcase_08 AC 44 ms
49,756 KB
testcase_09 AC 44 ms
49,768 KB
testcase_10 AC 45 ms
49,860 KB
testcase_11 AC 45 ms
49,824 KB
testcase_12 AC 47 ms
49,720 KB
testcase_13 AC 44 ms
49,836 KB
testcase_14 AC 45 ms
49,860 KB
testcase_15 AC 45 ms
49,836 KB
testcase_16 AC 45 ms
49,716 KB
testcase_17 AC 46 ms
49,824 KB
testcase_18 AC 45 ms
49,824 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

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] = Integer.parseInt(sa[0]);
		a[1] = Integer.parseInt(br.readLine());
		a[2] = Integer.parseInt(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