結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー Rute
提出日時 2021-12-24 00:20:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 690 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 36,560 KB
最終ジャッジ日時 2024-09-20 03:16:04
合計ジャッジ時間 13,752 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
d = {}
n,m = map(int,input().split())
for i in range(n):
    s,a = input().split()
    d[s] = int(a)
for j in range(m):
    t,b = input().split()
    d[t] = int(b)
c = collections.Counter(d)
ans = []
for i,j in c.items():
    ans.append([i,j])
ans.sort()
for i in range(len(ans)):
    print(*ans[i])
0