結果

問題 No.394 ハーフパイプ(1)
ユーザー jimanojimano
提出日時 2018-01-20 15:30:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 4,790 ms
コンパイル使用メモリ 74,772 KB
実行使用メモリ 51,484 KB
最終ジャッジ日時 2023-08-26 08:59:08
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
51,308 KB
testcase_01 AC 59 ms
50,984 KB
testcase_02 AC 59 ms
51,044 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 59 ms
51,048 KB
testcase_07 WA -
testcase_08 AC 59 ms
50,936 KB
testcase_09 WA -
testcase_10 AC 59 ms
51,332 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).skip(1).limit(str.length - 2).sum() / (str.length - 2));

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