結果

問題 No.851 テストケース
ユーザー ks2mks2m
提出日時 2019-07-26 21:32:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 47 ms / 3,153 ms
コード長 788 bytes
コンパイル時間 2,072 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 50,220 KB
最終ジャッジ日時 2023-09-15 00:41:00
合計ジャッジ時間 4,353 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
50,160 KB
testcase_01 AC 47 ms
49,704 KB
testcase_02 AC 43 ms
49,412 KB
testcase_03 AC 47 ms
49,836 KB
testcase_04 AC 47 ms
49,972 KB
testcase_05 AC 46 ms
47,576 KB
testcase_06 AC 47 ms
49,580 KB
testcase_07 AC 46 ms
49,652 KB
testcase_08 AC 46 ms
49,972 KB
testcase_09 AC 46 ms
49,696 KB
testcase_10 AC 46 ms
50,124 KB
testcase_11 AC 46 ms
49,556 KB
testcase_12 AC 47 ms
49,700 KB
testcase_13 AC 46 ms
50,204 KB
testcase_14 AC 46 ms
49,936 KB
testcase_15 AC 47 ms
49,840 KB
testcase_16 AC 47 ms
49,776 KB
testcase_17 AC 46 ms
49,724 KB
testcase_18 AC 47 ms
49,636 KB
testcase_19 AC 43 ms
49,408 KB
testcase_20 AC 44 ms
49,348 KB
testcase_21 AC 46 ms
50,220 KB
testcase_22 AC 46 ms
47,892 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