結果

問題 No.1134 Deviation Score Ⅱ
ユーザー tenten
提出日時 2020-08-17 22:12:28
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 2,663 ms
コンパイル使用メモリ 84,372 KB
実行使用メモリ 59,048 KB
最終ジャッジ日時 2024-10-11 11:24:24
合計ジャッジ時間 14,812 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 23 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		double sum = 0;
		for (int i = 0; i < n; i++) {
		    arr[i] = sc.nextInt();
		    sum += arr[i];
		}
		double mean = sum / n;
		double ssum = 0;
		for (int i = 0; i < n; i++) {
		    ssum += (arr[i] - mean) * (arr[i] - mean);
		}
		double sd = Math.sqrt(ssum / n);
		int m = sc.nextInt() - 1;
		int ans = (int)((arr[m] - mean) * 10 / sd + 50);
		System.out.println(ans);
	}
}
0