結果

問題 No.394 ハーフパイプ(1)
ユーザー jimanojimano
提出日時 2018-01-20 15:10:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 693 bytes
コンパイル時間 4,759 ms
コンパイル使用メモリ 74,784 KB
実行使用メモリ 55,876 KB
最終ジャッジ日時 2023-08-26 08:57:57
合計ジャッジ時間 4,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,732 KB
testcase_01 AC 113 ms
55,700 KB
testcase_02 AC 117 ms
55,692 KB
testcase_03 AC 111 ms
55,868 KB
testcase_04 AC 111 ms
55,840 KB
testcase_05 AC 111 ms
55,876 KB
testcase_06 AC 109 ms
55,756 KB
testcase_07 AC 111 ms
55,532 KB
testcase_08 AC 111 ms
55,708 KB
testcase_09 AC 111 ms
55,832 KB
testcase_10 AC 110 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
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 = (Arrays.stream(score).sum() - score[0] - score[str.length - 1]) / (str.length - 2);

			System.out.printf("%.2f\n", avg);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0