結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー MasKoaTSMasKoaTS
提出日時 2021-12-24 21:04:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 405 ms / 2,000 ms
コード長 946 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 116,624 KB
最終ジャッジ日時 2023-10-20 07:56:53
合計ジャッジ時間 16,161 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
85,764 KB
testcase_01 AC 137 ms
85,768 KB
testcase_02 AC 137 ms
85,768 KB
testcase_03 AC 142 ms
85,664 KB
testcase_04 AC 173 ms
88,904 KB
testcase_05 AC 175 ms
88,872 KB
testcase_06 AC 169 ms
88,828 KB
testcase_07 AC 172 ms
88,900 KB
testcase_08 AC 173 ms
88,900 KB
testcase_09 AC 173 ms
88,840 KB
testcase_10 AC 173 ms
88,912 KB
testcase_11 AC 173 ms
88,832 KB
testcase_12 AC 144 ms
85,768 KB
testcase_13 AC 146 ms
85,628 KB
testcase_14 AC 145 ms
85,636 KB
testcase_15 AC 143 ms
85,764 KB
testcase_16 AC 142 ms
85,628 KB
testcase_17 AC 141 ms
85,768 KB
testcase_18 AC 144 ms
85,764 KB
testcase_19 AC 146 ms
85,768 KB
testcase_20 AC 145 ms
85,636 KB
testcase_21 AC 142 ms
85,632 KB
testcase_22 AC 144 ms
85,636 KB
testcase_23 AC 148 ms
85,632 KB
testcase_24 AC 143 ms
85,764 KB
testcase_25 AC 145 ms
85,764 KB
testcase_26 AC 145 ms
85,672 KB
testcase_27 AC 142 ms
85,636 KB
testcase_28 AC 141 ms
85,636 KB
testcase_29 AC 144 ms
85,768 KB
testcase_30 AC 148 ms
85,676 KB
testcase_31 AC 142 ms
85,636 KB
testcase_32 AC 262 ms
98,548 KB
testcase_33 AC 232 ms
97,976 KB
testcase_34 AC 301 ms
100,976 KB
testcase_35 AC 288 ms
100,200 KB
testcase_36 AC 305 ms
103,328 KB
testcase_37 AC 233 ms
97,968 KB
testcase_38 AC 236 ms
98,064 KB
testcase_39 AC 316 ms
102,492 KB
testcase_40 AC 264 ms
101,076 KB
testcase_41 AC 301 ms
101,932 KB
testcase_42 AC 248 ms
99,540 KB
testcase_43 AC 261 ms
100,972 KB
testcase_44 AC 286 ms
102,736 KB
testcase_45 AC 256 ms
99,828 KB
testcase_46 AC 320 ms
103,260 KB
testcase_47 AC 209 ms
93,848 KB
testcase_48 AC 243 ms
96,920 KB
testcase_49 AC 405 ms
104,076 KB
testcase_50 AC 242 ms
96,996 KB
testcase_51 AC 241 ms
97,812 KB
testcase_52 AC 358 ms
107,156 KB
testcase_53 AC 345 ms
107,080 KB
testcase_54 AC 394 ms
116,624 KB
testcase_55 AC 388 ms
115,604 KB
testcase_56 AC 397 ms
115,604 KB
testcase_57 AC 393 ms
115,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from copy import deepcopy as dcopy
import math
import sys
sys.setrecursionlimit(10**6)
def input():
    return sys.stdin.readline().rstrip()
def getN():
	return int(sys.stdin.readline())
def getNs():
	return map(int,sys.stdin.readline().split())
def getList():
	return list(map(int,sys.stdin.readline().split()))
def strinps(n):
	return [sys.stdin.readline().rstrip() for _ in range(n)]
pi = 3.141592653589793
mod = 10**9+7
MOD = 998244353
INF = math.inf
dx = [1,0,-1,0];	dy = [0,1,0,-1]


"""
Main Code
"""

n,m = getNs()
name = set([])
rate = coll.defaultdict(int)
for _ in [0]*n:
	s,t = map(str,sys.stdin.readline().split())
	a = int(t)
	name.add(s)
	rate[s] = a
for _ in [0]*m:
	s,t = map(str,sys.stdin.readline().split())
	a = int(t)
	name.add(s)
	rate[s] = a
for s in sorted(name):
	print(s + " " + str(rate[s]))
0