結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー tktk_snsntktk_snsn
提出日時 2021-12-24 12:11:25
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 632 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 33,648 KB
最終ジャッジ日時 2023-10-20 07:54:33
合計ジャッジ時間 13,470 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,108 KB
testcase_01 AC 29 ms
10,108 KB
testcase_02 AC 29 ms
10,108 KB
testcase_03 AC 30 ms
10,120 KB
testcase_04 AC 41 ms
10,688 KB
testcase_05 AC 40 ms
10,688 KB
testcase_06 AC 42 ms
10,688 KB
testcase_07 AC 42 ms
10,616 KB
testcase_08 AC 42 ms
10,584 KB
testcase_09 AC 44 ms
10,700 KB
testcase_10 AC 44 ms
10,688 KB
testcase_11 AC 42 ms
10,624 KB
testcase_12 AC 30 ms
10,112 KB
testcase_13 AC 30 ms
10,132 KB
testcase_14 AC 30 ms
10,120 KB
testcase_15 AC 30 ms
10,112 KB
testcase_16 AC 30 ms
10,132 KB
testcase_17 AC 30 ms
10,120 KB
testcase_18 AC 30 ms
10,132 KB
testcase_19 AC 29 ms
10,120 KB
testcase_20 AC 30 ms
10,152 KB
testcase_21 AC 30 ms
10,120 KB
testcase_22 AC 30 ms
10,136 KB
testcase_23 AC 29 ms
10,120 KB
testcase_24 AC 30 ms
10,140 KB
testcase_25 AC 30 ms
10,144 KB
testcase_26 AC 30 ms
10,120 KB
testcase_27 AC 29 ms
10,140 KB
testcase_28 AC 29 ms
10,112 KB
testcase_29 AC 29 ms
10,132 KB
testcase_30 AC 29 ms
10,120 KB
testcase_31 AC 30 ms
10,120 KB
testcase_32 AC 267 ms
20,900 KB
testcase_33 AC 185 ms
16,772 KB
testcase_34 AC 391 ms
25,376 KB
testcase_35 AC 344 ms
24,308 KB
testcase_36 AC 384 ms
24,732 KB
testcase_37 AC 221 ms
20,272 KB
testcase_38 AC 205 ms
18,128 KB
testcase_39 AC 414 ms
30,308 KB
testcase_40 AC 290 ms
20,644 KB
testcase_41 AC 388 ms
29,612 KB
testcase_42 AC 252 ms
19,828 KB
testcase_43 AC 262 ms
19,948 KB
testcase_44 AC 328 ms
22,264 KB
testcase_45 AC 255 ms
20,012 KB
testcase_46 AC 436 ms
30,448 KB
testcase_47 AC 127 ms
14,944 KB
testcase_48 AC 246 ms
19,244 KB
testcase_49 AC 458 ms
31,032 KB
testcase_50 AC 250 ms
23,200 KB
testcase_51 AC 215 ms
20,208 KB
testcase_52 AC 497 ms
33,372 KB
testcase_53 AC 504 ms
33,376 KB
testcase_54 AC 621 ms
33,648 KB
testcase_55 AC 607 ms
33,644 KB
testcase_56 AC 632 ms
33,644 KB
testcase_57 AC 598 ms
33,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = [-1] * N
B = [-1] * N
C = [-1] * M
D = [-1] * M

for i in range(N):
    s, t = input().split()
    A[i] = s
    B[i] = int(t)

for i in range(M):
    s, t = input().split()
    C[i] = s
    D[i] = int(t)


name = sorted(set(A) | set(C))
name_to_i = {n: i for i, n in enumerate(name)}
score = [0] * (len(name))

for a, b in zip(A, B):
    i = name_to_i[a]
    score[i] = b

for c, d in zip(C, D):
    i = name_to_i[c]
    score[i] = d

for i in range(len(name)):
    print(name[i], score[i])
0