結果

問題 No.938 賢人を探せ
ユーザー kbyskbys
提出日時 2020-06-23 07:25:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 17,468 KB
最終ジャッジ日時 2023-08-21 03:45:37
合計ジャッジ時間 2,406 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,692 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 16 ms
7,904 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 16 ms
7,884 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 15 ms
7,948 KB
testcase_08 AC 62 ms
12,144 KB
testcase_09 AC 63 ms
12,264 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 78 ms
17,468 KB
testcase_12 AC 61 ms
12,152 KB
testcase_13 AC 62 ms
12,192 KB
testcase_14 AC 61 ms
12,152 KB
testcase_15 AC 60 ms
12,032 KB
testcase_16 AC 61 ms
12,100 KB
testcase_17 AC 60 ms
12,020 KB
testcase_18 AC 62 ms
12,156 KB
testcase_19 AC 60 ms
12,036 KB
testcase_20 AC 60 ms
12,168 KB
testcase_21 AC 61 ms
12,164 KB
testcase_22 AC 85 ms
15,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

bad = [0]*N
cand = [0]*N#答えの候補
for i in range(N):
    b, c = list(input().split())
    bad[i] = b
    cand[i] = c

remove = set(bad)&set(cand)#見られただけかと思いきやカンニングもしてたやつら

already = {}

for c in cand:
    if c not in remove:
        if c not in already:
            print(c)
            already[c] = 0
0