結果

問題 No.2590 100000 Days of Christmas
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-12-18 17:04:43
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 299 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,272 KB
最終ジャッジ日時 2023-12-18 17:04:48
合計ジャッジ時間 4,735 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
60,264 KB
testcase_01 AC 39 ms
55,616 KB
testcase_02 AC 40 ms
53,460 KB
testcase_03 AC 40 ms
53,460 KB
testcase_04 AC 39 ms
53,460 KB
testcase_05 AC 45 ms
61,976 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N = int(input())
d = defaultdict(int)
pre = defaultdict(int)
for i in range(N):
    S = input()
    for k, v in pre.items():
        d[k] += v
    pre[S] += i + 1
    d[S] += i + 1
ans = [(k, v) for k, v in d.items()]
ans.sort()
for k, v in ans:
    print(v, k)
0