結果

問題 No.938 賢人を探せ
ユーザー brthyyjpbrthyyjp
提出日時 2020-11-24 11:50:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 87,584 KB
最終ジャッジ日時 2023-08-21 03:47:43
合計ジャッジ時間 4,283 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
87,488 KB
testcase_01 AC 75 ms
71,176 KB
testcase_02 AC 73 ms
71,228 KB
testcase_03 AC 74 ms
71,268 KB
testcase_04 AC 75 ms
71,228 KB
testcase_05 AC 74 ms
71,280 KB
testcase_06 AC 74 ms
71,132 KB
testcase_07 AC 75 ms
71,324 KB
testcase_08 AC 121 ms
80,948 KB
testcase_09 AC 122 ms
80,124 KB
testcase_10 AC 77 ms
71,412 KB
testcase_11 AC 126 ms
82,588 KB
testcase_12 AC 131 ms
79,584 KB
testcase_13 AC 129 ms
79,584 KB
testcase_14 AC 130 ms
79,656 KB
testcase_15 AC 130 ms
79,724 KB
testcase_16 AC 129 ms
79,832 KB
testcase_17 AC 129 ms
79,904 KB
testcase_18 AC 130 ms
79,556 KB
testcase_19 AC 131 ms
79,724 KB
testcase_20 AC 134 ms
79,624 KB
testcase_21 AC 138 ms
79,668 KB
testcase_22 AC 158 ms
87,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = set()
A = []
d = {}
for i in range(n):
    a, b = map(str, input().split())
    S.add(a)
    S.add(b)
    A.append(a)
    if b not in d:
        d[b] = i

for a in A:
    S.discard(a)

X = []
for x in S:
    X.append((d[x], x))
X.sort()
for _, x in X:
    print(x)
0