結果
問題 |
No.198 キャンディー・ボックス2
|
ユーザー |
![]() |
提出日時 | 2016-03-07 18:09:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 14,080 KB |
最終ジャッジ日時 | 2024-09-24 15:11:26 |
合計ジャッジ時間 | 3,213 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 WA * 5 |
ソースコード
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import array import statistics def solve(candies): median = statistics.median_low(candies) return sum(map(lambda c: abs(c - median), candies)) def main(): b = int(input()) n = int(input()) candies = array.array("L", (int(input()) for _ in range(n))) print(solve(candies)) if __name__ == '__main__': main()