結果

問題 No.938 賢人を探せ
ユーザー seica_at_seseica_at_se
提出日時 2019-12-12 01:08:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 13,780 KB
最終ジャッジ日時 2024-05-08 09:05:17
合計ジャッジ時間 2,730 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
13,776 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 36 ms
10,752 KB
testcase_06 AC 32 ms
10,752 KB
testcase_07 AC 32 ms
10,880 KB
testcase_08 AC 87 ms
12,412 KB
testcase_09 AC 91 ms
12,604 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 101 ms
12,656 KB
testcase_12 AC 89 ms
12,404 KB
testcase_13 AC 89 ms
12,400 KB
testcase_14 AC 88 ms
12,408 KB
testcase_15 AC 89 ms
12,536 KB
testcase_16 AC 86 ms
12,404 KB
testcase_17 AC 88 ms
12,400 KB
testcase_18 AC 88 ms
12,404 KB
testcase_19 AC 88 ms
12,404 KB
testcase_20 AC 88 ms
12,400 KB
testcase_21 AC 89 ms
12,404 KB
testcase_22 AC 118 ms
13,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

mp = {}
name = []
for i in range(n):
    a, b = input().split()
    if mp.get(a) == None:
        mp[a] = 0
    if mp.get(b) == None:
        mp[b] = 0
    mp[a] += 1
    name.append(b)

for str in name:
    if mp[str] == 0:
        print(str)
    mp[str] += 1
0