結果

問題 No.394 ハーフパイプ(1)
ユーザー jimanojimano
提出日時 2018-01-20 15:32:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 2,805 ms
コンパイル使用メモリ 74,900 KB
実行使用メモリ 52,200 KB
最終ジャッジ日時 2023-08-26 08:59:34
合計ジャッジ時間 4,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
52,040 KB
testcase_01 AC 61 ms
51,744 KB
testcase_02 AC 58 ms
52,184 KB
testcase_03 AC 61 ms
51,932 KB
testcase_04 AC 61 ms
51,928 KB
testcase_05 AC 60 ms
51,896 KB
testcase_06 AC 61 ms
51,968 KB
testcase_07 AC 58 ms
51,828 KB
testcase_08 AC 62 ms
52,200 KB
testcase_09 AC 60 ms
51,888 KB
testcase_10 AC 59 ms
52,028 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(" ");
			double[] score = new double[str.length];

			for (int i = 0; i < str.length; i++) {
				score[i] = Double.parseDouble(str[i]);
			}
			Arrays.sort(score);
			double avg = (double) (Arrays.stream(score).skip(1).limit(str.length - 2).sum() / (str.length - 2));

			System.out.println(new BigDecimal(avg).setScale(2));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0