結果
問題 |
No.2590 100000 Days of Christmas
|
ユーザー |
|
提出日時 | 2024-10-01 17:14:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 613 ms / 2,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 32,296 KB |
最終ジャッジ日時 | 2024-10-01 17:14:19 |
合計ジャッジ時間 | 6,465 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
from collections import defaultdict import sys def printe(*args, end="\n", **kwargs): print(*args, end=end, file=sys.stderr, **kwargs) def main(): N = int(input()) presents = [input() for _ in range(N)] present_day = defaultdict(int) for idx, present in enumerate(presents, 1): present_day[present] += idx * (N - idx + 1) printe(present_day) for present, n in sorted(present_day.items()): print(n, present) if __name__ == "__main__": main()