結果

問題 No.1134 Deviation Score Ⅱ
ユーザー face4
提出日時 2020-08-04 21:45:01
言語 Java
(openjdk 27 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 790 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,062 ms
コンパイル使用メモリ 91,532 KB
実行使用メモリ 54,624 KB
最終ジャッジ日時 2026-10-16 21:58:50
合計ジャッジ時間 6,756 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 28 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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