結果
| 問題 | No.198 キャンディー・ボックス2 |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-03-07 18:09:08 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 388 bytes |
| 記録 | |
| コンパイル時間 | 826 ms |
| コンパイル使用メモリ | 21,336 KB |
| 実行使用メモリ | 16,556 KB |
| 最終ジャッジ日時 | 2026-09-03 07:25:04 |
| 合計ジャッジ時間 | 6,905 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 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()
はむ吉🐹