結果

問題 No.1134 Deviation Score Ⅱ
ユーザー lam6er
提出日時 2025-04-16 00:52:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 82,036 KB
実行使用メモリ 83,876 KB
最終ジャッジ日時 2025-04-16 00:55:10
合計ジャッジ時間 2,533 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
x = list(map(int, input().split()))
m = int(input()) - 1  # Convert to 0-based index

x_m = x[m]
sum_x = sum(x)
mean = sum_x / n

sum_squares = 0.0
for xi in x:
    diff = xi - mean
    sum_squares += diff * diff

variance = sum_squares / n
std_dev = math.sqrt(variance)

if std_dev == 0:
    print(50)
else:
    temp = 10 * (x_m - mean) / std_dev
    if x_m > mean:
        ans_float = 50 + temp
    else:
        ans_float = 50 - temp
    print(int(ans_float))
0