結果
問題 | No.1134 Deviation Score Ⅱ |
ユーザー | xRS43BofaUEZ5gc |
提出日時 | 2021-03-18 16:06:27 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 611 bytes |
コンパイル時間 | 3,097 ms |
コンパイル使用メモリ | 74,540 KB |
実行使用メモリ | 48,588 KB |
最終ジャッジ日時 | 2024-04-28 06:13:05 |
合計ジャッジ時間 | 14,643 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
41,360 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 345 ms
48,156 KB |
testcase_05 | WA | - |
testcase_06 | AC | 310 ms
47,892 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 272 ms
47,596 KB |
testcase_10 | AC | 191 ms
43,012 KB |
testcase_11 | AC | 445 ms
47,800 KB |
testcase_12 | WA | - |
testcase_13 | AC | 509 ms
48,356 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 284 ms
47,624 KB |
testcase_17 | AC | 459 ms
48,112 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 123 ms
41,128 KB |
ソースコード
import java.util.Scanner; public class HelloWorld { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] xi = new int[n]; int sum = 0; for (int i=0;i<n;i++) { xi[i] = sc.nextInt(); sum += xi[i]; } int m = sc.nextInt(); sc.close(); int average = sum / n; sum = 0; for (int i=0;i<n;i++) { sum = sum + (xi[i] - average) * (xi[i] - average); } double sqrt = Math.sqrt(sum / n); double ans = (xi[m - 1] - average) * 10 / sqrt; System.out.println(ans > 0 ? (int)(50 + ans) : (int)(50 - ans)); } }