結果

問題 No.1134 Deviation Score Ⅱ
ユーザー tentententen
提出日時 2020-08-17 22:12:28
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 74,180 KB
実行使用メモリ 61,016 KB
最終ジャッジ日時 2024-04-19 19:13:19
合計ジャッジ時間 12,649 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
52,736 KB
testcase_01 AC 456 ms
59,504 KB
testcase_02 AC 447 ms
59,212 KB
testcase_03 AC 465 ms
59,324 KB
testcase_04 AC 319 ms
59,552 KB
testcase_05 AC 458 ms
59,496 KB
testcase_06 AC 289 ms
59,340 KB
testcase_07 AC 257 ms
57,996 KB
testcase_08 AC 425 ms
59,520 KB
testcase_09 AC 244 ms
58,960 KB
testcase_10 AC 173 ms
57,052 KB
testcase_11 AC 423 ms
59,340 KB
testcase_12 AC 423 ms
59,236 KB
testcase_13 AC 499 ms
59,684 KB
testcase_14 AC 383 ms
57,876 KB
testcase_15 AC 404 ms
59,240 KB
testcase_16 AC 265 ms
58,792 KB
testcase_17 AC 417 ms
59,372 KB
testcase_18 AC 432 ms
59,636 KB
testcase_19 AC 475 ms
59,276 KB
testcase_20 AC 388 ms
59,436 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 230 ms
57,532 KB
testcase_26 AC 438 ms
59,180 KB
testcase_27 AC 106 ms
53,200 KB
権限があれば一括ダウンロードができます

ソースコード

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