結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
49,644 KB
testcase_01 AC 46 ms
49,648 KB
testcase_02 WA -
testcase_03 AC 46 ms
49,612 KB
testcase_04 AC 45 ms
49,920 KB
testcase_05 AC 47 ms
49,556 KB
testcase_06 AC 47 ms
50,196 KB
testcase_07 AC 46 ms
49,952 KB
testcase_08 AC 46 ms
49,896 KB
testcase_09 AC 47 ms
49,644 KB
testcase_10 AC 45 ms
49,884 KB
testcase_11 AC 47 ms
47,816 KB
testcase_12 AC 47 ms
49,604 KB
testcase_13 AC 47 ms
49,648 KB
testcase_14 AC 46 ms
49,848 KB
testcase_15 AC 47 ms
49,688 KB
testcase_16 AC 46 ms
49,680 KB
testcase_17 AC 47 ms
49,768 KB
testcase_18 AC 47 ms
49,844 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]);
		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]);
		}
	}
}
0