結果

問題 No.1134 Deviation Score Ⅱ
ユーザー ThetaTheta
提出日時 2022-10-20 17:10:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 17,000 KB
最終ジャッジ日時 2023-09-12 21:57:52
合計ジャッジ時間 3,529 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 52 ms
14,684 KB
testcase_02 AC 40 ms
12,756 KB
testcase_03 AC 46 ms
13,972 KB
testcase_04 AC 30 ms
10,704 KB
testcase_05 AC 53 ms
14,756 KB
testcase_06 AC 26 ms
9,960 KB
testcase_07 AC 22 ms
9,436 KB
testcase_08 AC 46 ms
13,764 KB
testcase_09 AC 22 ms
9,296 KB
testcase_10 AC 17 ms
8,036 KB
testcase_11 AC 39 ms
12,820 KB
testcase_12 AC 39 ms
12,404 KB
testcase_13 AC 55 ms
15,476 KB
testcase_14 AC 39 ms
12,920 KB
testcase_15 AC 32 ms
11,432 KB
testcase_16 AC 23 ms
9,640 KB
testcase_17 AC 39 ms
12,684 KB
testcase_18 AC 41 ms
12,804 KB
testcase_19 AC 48 ms
14,092 KB
testcase_20 AC 33 ms
11,456 KB
testcase_21 AC 48 ms
15,016 KB
testcase_22 AC 39 ms
9,436 KB
testcase_23 AC 17 ms
8,032 KB
testcase_24 AC 16 ms
7,916 KB
testcase_25 AC 20 ms
9,244 KB
testcase_26 AC 57 ms
17,000 KB
testcase_27 AC 16 ms
8,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


from math import sqrt, floor


def main():
    N = int(input())
    scores = list(map(int, input().split()))
    M = int(input())

    average = sum(scores) / N
    std_deviation = sqrt(
        sum(map(lambda score: (score - average)**2, scores))/N)
    try:
        deviation_score = 50 + (scores[M-1] - average)*10/std_deviation
    except ZeroDivisionError:
        deviation_score = 50

    if deviation_score >= 0:
        print(floor(deviation_score))
    else:
        print(-1*floor(abs(deviation_score)))


if __name__ == "__main__":
    main()
0