結果

問題 No.2590 100000 Days of Christmas
ユーザー lloyzlloyz
提出日時 2023-12-19 20:06:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 400 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 96,608 KB
最終ジャッジ日時 2023-12-19 20:07:02
合計ジャッジ時間 5,038 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 40 ms
53,460 KB
testcase_03 AC 40 ms
53,460 KB
testcase_04 AC 41 ms
53,460 KB
testcase_05 AC 42 ms
55,616 KB
testcase_06 AC 225 ms
96,608 KB
testcase_07 AC 110 ms
76,152 KB
testcase_08 AC 399 ms
94,872 KB
testcase_09 AC 112 ms
76,156 KB
testcase_10 AC 41 ms
53,460 KB
testcase_11 AC 40 ms
53,460 KB
testcase_12 AC 40 ms
53,460 KB
testcase_13 AC 39 ms
53,460 KB
testcase_14 AC 40 ms
53,460 KB
testcase_15 AC 39 ms
53,460 KB
testcase_16 AC 40 ms
53,460 KB
testcase_17 AC 40 ms
53,460 KB
testcase_18 AC 41 ms
53,460 KB
testcase_19 AC 41 ms
53,460 KB
testcase_20 AC 400 ms
95,228 KB
testcase_21 AC 375 ms
95,056 KB
testcase_22 AC 352 ms
96,140 KB
testcase_23 AC 399 ms
95,228 KB
権限があれば一括ダウンロードができます

ソースコード

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