結果

問題 No.938 賢人を探せ
ユーザー hir355hir355
提出日時 2020-04-03 16:41:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 17,636 KB
最終ジャッジ日時 2023-08-21 03:45:05
合計ジャッジ時間 2,426 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
17,636 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 15 ms
7,808 KB
testcase_04 AC 14 ms
7,856 KB
testcase_05 AC 15 ms
7,812 KB
testcase_06 AC 16 ms
7,908 KB
testcase_07 AC 15 ms
7,860 KB
testcase_08 AC 64 ms
11,568 KB
testcase_09 AC 66 ms
11,508 KB
testcase_10 AC 15 ms
7,856 KB
testcase_11 AC 81 ms
15,444 KB
testcase_12 AC 62 ms
11,600 KB
testcase_13 AC 63 ms
11,636 KB
testcase_14 AC 61 ms
11,560 KB
testcase_15 AC 61 ms
11,468 KB
testcase_16 AC 61 ms
11,468 KB
testcase_17 AC 61 ms
11,652 KB
testcase_18 AC 62 ms
11,512 KB
testcase_19 AC 62 ms
11,492 KB
testcase_20 AC 61 ms
11,504 KB
testcase_21 AC 62 ms
11,604 KB
testcase_22 AC 95 ms
17,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = set()
st = set()
l = []
for _ in range(n):
    a, b = input().split()
    l.append(b)
    s.add(a)
    s.add(b)
    st.add(a)
s = s - st
t = set()
for x in l:
    if x not in t:
        t.add(x)
        if x in s:
            print(x)
0