結果

問題 No.938 賢人を探せ
ユーザー yomo3yomo3
提出日時 2020-02-21 14:24:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 13,376 KB
最終ジャッジ日時 2023-08-21 03:43:41
合計ジャッジ時間 2,236 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
13,360 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,888 KB
testcase_03 AC 16 ms
7,872 KB
testcase_04 AC 17 ms
7,756 KB
testcase_05 AC 16 ms
7,892 KB
testcase_06 AC 16 ms
7,912 KB
testcase_07 AC 16 ms
7,876 KB
testcase_08 AC 61 ms
11,252 KB
testcase_09 AC 61 ms
10,856 KB
testcase_10 AC 16 ms
7,876 KB
testcase_11 AC 69 ms
11,776 KB
testcase_12 AC 57 ms
10,348 KB
testcase_13 AC 57 ms
10,388 KB
testcase_14 AC 57 ms
10,392 KB
testcase_15 AC 57 ms
10,348 KB
testcase_16 AC 57 ms
10,496 KB
testcase_17 AC 58 ms
10,380 KB
testcase_18 AC 57 ms
10,340 KB
testcase_19 AC 57 ms
10,420 KB
testcase_20 AC 58 ms
10,372 KB
testcase_21 AC 57 ms
10,344 KB
testcase_22 AC 83 ms
13,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter

N = int(input())
A = []
B = {}
for i in range(N):
    a, b = input().split()
    A.append(a)
    if b not in B:
        B[b] = i

for a in A:
    if a in B:
        del B[a]

C = sorted(B.items(), key=itemgetter(1))

for k, _ in C:
    print(k)
0