結果

問題 No.1134 Deviation Score Ⅱ
ユーザー koba-e964koba-e964
提出日時 2021-10-15 10:26:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 78,812 KB
最終ジャッジ日時 2023-10-17 19:35:25
合計ジャッジ時間 4,226 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,600 KB
testcase_01 AC 59 ms
74,996 KB
testcase_02 AC 50 ms
71,096 KB
testcase_03 AC 54 ms
73,520 KB
testcase_04 AC 47 ms
64,856 KB
testcase_05 AC 56 ms
75,000 KB
testcase_06 AC 45 ms
63,368 KB
testcase_07 AC 43 ms
62,332 KB
testcase_08 AC 53 ms
73,496 KB
testcase_09 AC 43 ms
62,056 KB
testcase_10 AC 42 ms
60,008 KB
testcase_11 AC 50 ms
71,068 KB
testcase_12 AC 50 ms
70,096 KB
testcase_13 AC 56 ms
76,612 KB
testcase_14 AC 51 ms
71,076 KB
testcase_15 AC 47 ms
65,500 KB
testcase_16 AC 44 ms
62,632 KB
testcase_17 AC 50 ms
70,104 KB
testcase_18 AC 50 ms
71,104 KB
testcase_19 AC 53 ms
73,564 KB
testcase_20 AC 47 ms
68,240 KB
testcase_21 AC 53 ms
73,456 KB
testcase_22 AC 52 ms
73,316 KB
testcase_23 AC 37 ms
53,544 KB
testcase_24 AC 37 ms
53,544 KB
testcase_25 AC 43 ms
62,056 KB
testcase_26 AC 57 ms
78,812 KB
testcase_27 AC 38 ms
53,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import sys
import math
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

n = int(readline())
x = list(map(int, readline().split()))
m = int(readline()) - 1

s = 0
sq = 0

for a in x:
    s += a
    sq += a * a

v = sq * n - s * s
if v == 0:
    print('50')
else:
    d = x[m] * n - s
    ans = d / math.sqrt(v) * 10 + 50
    if ans < 0:
        ans = math.ceil(ans)
    else:
        ans = math.floor(ans)
    print(int(ans))
0