結果

問題 No.1795 AtCoder Heuristic Rating coloring
コンテスト
ユーザー lloyz
提出日時 2021-12-24 23:40:49
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 285 ms / 2,000 ms
+ 433µs
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 219 ms
コンパイル使用メモリ 95,696 KB
実行使用メモリ 106,284 KB
最終ジャッジ日時 2026-08-31 13:06:51
合計ジャッジ時間 14,219 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import defaultdict

n, m = map(int, input().split())
Rate = defaultdict(int)
for _ in range(n):
    s, a = input().split()
    Rate[s] = int(a)
for _ in range(m):
    t, b = input().split()
    Rate[t] = int(b)

ANS = [(name, score) for name, score in Rate.items()]
ANS.sort(key=lambda x: x[0])
for name, score in ANS:
    print(name, score)
0