結果

問題 No.2590 100000 Days of Christmas
ユーザー hirayuu_yc
提出日時 2023-12-18 07:54:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 99,400 KB
最終ジャッジ日時 2024-09-27 08:16:41
合計ジャッジ時間 5,326 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N=int(input())
dic=defaultdict(int)
for i in range(N):
	S=input()
	dic[S]+=(i+1)*(N-i)
ans=[]
for i in dic:
	ans.append((i,dic[i]))
ans.sort()
for p,c in ans:
	print(c,p)
0