結果
問題 | No.2590 100000 Days of Christmas |
ユーザー |
|
提出日時 | 2024-10-01 17:13:49 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 551 ms / 2,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 118,604 KB |
最終ジャッジ日時 | 2024-10-01 17:13:57 |
合計ジャッジ時間 | 6,912 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
from collections import defaultdictimport sysdef 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()