結果

問題 No.938 賢人を探せ
ユーザー yomo3
提出日時 2020-02-21 14:46:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,352 KB
最終ジャッジ日時 2024-12-14 11:57:30
合計ジャッジ時間 2,646 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter

N = int(input())
AB = [input().split() for _ in range(N)]

A = set(a for a, _ in AB)
done = set()
for _, b in AB:
    if b not in A and b not in done:
        print(b)
        done.add(b)
0