結果
| 問題 | No.1795 AtCoder Heuristic Rating coloring | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-12-24 23:40:49 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 393 ms / 2,000 ms | 
| コード長 | 359 bytes | 
| コンパイル時間 | 233 ms | 
| コンパイル使用メモリ | 81,840 KB | 
| 実行使用メモリ | 99,520 KB | 
| 最終ジャッジ日時 | 2024-09-20 03:26:59 | 
| 合計ジャッジ時間 | 11,007 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 54 | 
ソースコード
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)
            
            
            
        