結果

問題 No.938 賢人を探せ
ユーザー hir355hir355
提出日時 2020-04-03 16:41:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 19,756 KB
最終ジャッジ日時 2024-05-08 09:14:04
合計ジャッジ時間 2,954 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
19,632 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 35 ms
10,752 KB
testcase_06 AC 32 ms
10,880 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 92 ms
13,660 KB
testcase_09 AC 96 ms
13,728 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 114 ms
17,544 KB
testcase_12 AC 87 ms
13,724 KB
testcase_13 AC 92 ms
13,720 KB
testcase_14 AC 87 ms
13,720 KB
testcase_15 AC 88 ms
13,716 KB
testcase_16 AC 89 ms
13,712 KB
testcase_17 AC 87 ms
13,720 KB
testcase_18 AC 89 ms
13,724 KB
testcase_19 AC 90 ms
13,700 KB
testcase_20 AC 93 ms
13,716 KB
testcase_21 AC 89 ms
13,724 KB
testcase_22 AC 130 ms
19,756 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