結果

問題 No.2590 100000 Days of Christmas
ユーザー lloyz
提出日時 2023-12-19 20:06:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 392 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 96,892 KB
最終ジャッジ日時 2024-09-27 08:59:25
合計ジャッジ時間 5,028 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())
counter = defaultdict(int)
for i in range(n):
    s = input()
    counter[s] += (i + 1) * (n - i)
L = [(k, v) for k, v in counter.items()]
L.sort(key=lambda x: x[0])
for k, v in L:
    print(v, k)
0