結果
問題 |
No.1134 Deviation Score Ⅱ
|
ユーザー |
|
提出日時 | 2020-08-04 21:45:01 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 191 ms / 2,000 ms |
コード長 | 790 bytes |
コンパイル時間 | 2,297 ms |
コンパイル使用メモリ | 74,720 KB |
実行使用メモリ | 60,660 KB |
最終ジャッジ日時 | 2024-09-14 21:12:18 |
合計ジャッジ時間 | 7,367 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 27 |
ソースコード
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); } }