結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー titan23
提出日時 2022-06-28 23:29:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 480 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 103,556 KB
最終ジャッジ日時 2024-11-21 18:38:08
合計ジャッジ時間 12,302 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
input = lambda: sys.stdin.readline().rstrip()

#  -----------------------  #

n, m = map(int, input().split())
sa = defaultdict(lambda: -1)
for _ in range(n):
  s, a = input().split()
  sa[s] = a

ans = []
for _ in range(m):
  t, b = input().split()
  sa[t] = b

for k,v in sorted(sa.items()):
  print(k, v)
0