結果

問題 No.394 ハーフパイプ(1)
ユーザー jimanojimano
提出日時 2018-01-20 15:02:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 4,511 ms
コンパイル使用メモリ 79,128 KB
実行使用メモリ 51,120 KB
最終ジャッジ日時 2023-08-26 08:55:59
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
49,144 KB
testcase_01 AC 52 ms
51,072 KB
testcase_02 AC 52 ms
51,004 KB
testcase_03 AC 52 ms
50,952 KB
testcase_04 AC 52 ms
50,796 KB
testcase_05 AC 51 ms
50,884 KB
testcase_06 AC 52 ms
50,968 KB
testcase_07 AC 52 ms
50,768 KB
testcase_08 AC 54 ms
51,120 KB
testcase_09 AC 52 ms
51,052 KB
testcase_10 AC 55 ms
51,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Arrays;

public class No0394 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] str = br.readLine().split(" ");
			int[] score = new int[str.length];

			for (int i = 0; i < str.length; i++) {
				score[i] = Integer.parseInt(str[i]);
			}
			Arrays.sort(score);
			double avg = (double)(Arrays.stream(score).sum() - score[0] - score[str.length - 1]) / (str.length - 2);
			
			System.out.println(new BigDecimal(avg).setScale(2));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0