結果

問題 No.1134 Deviation Score Ⅱ
ユーザー face4face4
提出日時 2020-08-04 21:45:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 790 bytes
コンパイル時間 4,195 ms
コンパイル使用メモリ 70,920 KB
実行使用メモリ 60,792 KB
最終ジャッジ日時 2023-10-12 23:03:30
合計ジャッジ時間 9,436 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,432 KB
testcase_01 AC 158 ms
58,392 KB
testcase_02 AC 144 ms
58,480 KB
testcase_03 AC 151 ms
58,324 KB
testcase_04 AC 96 ms
54,464 KB
testcase_05 AC 159 ms
58,192 KB
testcase_06 AC 95 ms
54,184 KB
testcase_07 AC 86 ms
52,444 KB
testcase_08 AC 150 ms
58,416 KB
testcase_09 AC 76 ms
52,004 KB
testcase_10 AC 53 ms
51,180 KB
testcase_11 AC 126 ms
56,820 KB
testcase_12 AC 131 ms
56,836 KB
testcase_13 AC 167 ms
60,488 KB
testcase_14 AC 132 ms
57,144 KB
testcase_15 AC 111 ms
54,176 KB
testcase_16 AC 85 ms
52,472 KB
testcase_17 AC 120 ms
56,860 KB
testcase_18 AC 144 ms
58,652 KB
testcase_19 AC 152 ms
58,768 KB
testcase_20 AC 118 ms
54,132 KB
testcase_21 AC 154 ms
58,276 KB
testcase_22 AC 143 ms
57,984 KB
testcase_23 AC 43 ms
49,796 KB
testcase_24 AC 43 ms
49,320 KB
testcase_25 AC 82 ms
52,064 KB
testcase_26 AC 184 ms
60,792 KB
testcase_27 AC 43 ms
49,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] line = br.readLine().split(" ");
        int x[] = new int[n];
        double sum = 0;
        for(int i = 0; i < n; i++){
            x[i] = Integer.parseInt(line[i]);
            sum += x[i];
        }
        sum /= n;
        double d = 0;
        for(int i = 0; i < n; i++){
            d += Math.pow(sum-x[i], 2.0);
        }
        d = Math.sqrt(d/n);
        int m = Integer.parseInt(br.readLine())-1;
        int ret = 50;
        if(d > 0){
            ret += (x[m]-sum)*10/d;
        }
        System.out.println(ret);
    }
}
0