結果
| 問題 |
No.938 賢人を探せ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-01 10:25:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 2,000 ms |
| コード長 | 410 bytes |
| コンパイル時間 | 157 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 15,676 KB |
| 最終ジャッジ日時 | 2024-12-14 11:43:02 |
| 合計ジャッジ時間 | 2,155 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
from collections import defaultdict
from sys import stdin
def main():
input = lambda: stdin.readline()[:-1]
N = int(input())
AB = [tuple(input().split()) for _ in [0] * N]
student = defaultdict(int)
for a, b in AB:
student[a] = -1
ans = []
for a, b in AB:
if not student[b]:
ans.append(b)
student[b] = 1
print(*ans, sep='\n')
main()