結果

問題 No.394 ハーフパイプ(1)
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-09-30 19:47:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 709 bytes
コンパイル時間 2,883 ms
コンパイル使用メモリ 75,392 KB
実行使用メモリ 41,304 KB
最終ジャッジ日時 2024-04-27 16:58:59
合計ジャッジ時間 4,621 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
41,068 KB
testcase_01 AC 106 ms
41,048 KB
testcase_02 AC 103 ms
41,132 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 91 ms
39,724 KB
testcase_07 WA -
testcase_08 AC 103 ms
41,052 KB
testcase_09 WA -
testcase_10 AC 102 ms
40,948 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);
		int 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