結果

問題 No.394 ハーフパイプ(1)
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-09-30 20:38:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 711 bytes
コンパイル時間 4,180 ms
コンパイル使用メモリ 75,012 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2024-04-27 16:59:24
合計ジャッジ時間 5,363 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
54,104 KB
testcase_01 AC 122 ms
53,940 KB
testcase_02 AC 121 ms
53,852 KB
testcase_03 AC 118 ms
53,984 KB
testcase_04 AC 122 ms
53,784 KB
testcase_05 AC 121 ms
54,112 KB
testcase_06 AC 122 ms
54,180 KB
testcase_07 AC 119 ms
54,052 KB
testcase_08 AC 121 ms
54,064 KB
testcase_09 AC 118 ms
54,036 KB
testcase_10 AC 120 ms
54,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class No394 {
	
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] temp = br.readLine().split(" ");
			int[] points = new int[temp.length];
			
			for(int i =0; i < temp.length; i++)
				points[i] = Integer.parseInt(temp[i]);
			System.out.printf("%.2f",getAve(points));
			
		}catch(Exception e){
			e.getStackTrace();
		}
	}
	
	
	public static double getAve(int[] x){
		Arrays.sort(x);
		double sum = 0;
		double ave = 0;
		for(int i=1; i < x.length - 1; i++)
			sum += x[i];
		ave = sum / (x.length - 2);
		return ave;
	}
}
0