結果

問題 No.394 ハーフパイプ(1)
ユーザー jimanojimano
提出日時 2018-01-20 15:15:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 766 bytes
コンパイル時間 3,488 ms
コンパイル使用メモリ 73,284 KB
実行使用メモリ 50,092 KB
最終ジャッジ日時 2023-08-26 08:57:25
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
50,092 KB
testcase_01 AC 43 ms
49,868 KB
testcase_02 AC 42 ms
49,996 KB
testcase_03 AC 42 ms
50,016 KB
testcase_04 AC 41 ms
49,892 KB
testcase_05 AC 42 ms
49,940 KB
testcase_06 AC 42 ms
49,812 KB
testcase_07 AC 41 ms
49,772 KB
testcase_08 AC 39 ms
49,872 KB
testcase_09 AC 39 ms
49,864 KB
testcase_10 AC 41 ms
49,904 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_2 {
	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];
			double sum = 0;

			for (int i = 0; i < str.length; i++) {
				score[i] = Integer.parseInt(str[i]);
			}
			Arrays.sort(score);

			for (int i = 1; i < str.length - 1; i++) {
				sum += score[i];
			}
			double avg = sum / (str.length - 2);

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