結果
| 問題 |
No.1134 Deviation Score Ⅱ
|
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:44:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 529 bytes |
| コンパイル時間 | 196 ms |
| コンパイル使用メモリ | 82,468 KB |
| 実行使用メモリ | 85,156 KB |
| 最終ジャッジ日時 | 2025-06-12 15:44:44 |
| 合計ジャッジ時間 | 2,620 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 WA * 14 |
ソースコード
import math
n = int(input())
x = list(map(int, input().split()))
m = int(input()) - 1 # Convert to 0-based index
sum_x = sum(x)
sum_x_sq = sum(a * a for a in x)
avg = sum_x / n
numerator = sum_x_sq - (sum_x ** 2) / n
variance = numerator / n
if abs(variance) < 1e-9:
std_dev = 0.0
else:
std_dev = math.sqrt(variance)
x_m = x[m]
if std_dev == 0:
print(50)
else:
diff = x_m - avg
temp = (diff * 10) / std_dev
if x_m > avg:
dev = 50 + temp
else:
dev = 50 - temp
print(int(dev))
gew1fw