結果

問題 No.938 賢人を探せ
ユーザー lam6er
提出日時 2025-03-20 21:15:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 79,656 KB
最終ジャッジ日時 2025-03-20 21:16:27
合計ジャッジ時間 2,879 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
cheaters = set()
copied_from = []

for _ in range(n):
    a, b = input().split()
    cheaters.add(a)
    copied_from.append(b)

seen = set()
result = []

for b in copied_from:
    if b not in cheaters and b not in seen:
        result.append(b)
        seen.add(b)

print('\n'.join(result))
0