結果

問題 No.938 賢人を探せ
ユーザー otsuri_114514otsuri_114514
提出日時 2019-12-10 23:52:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 740 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 80,988 KB
最終ジャッジ日時 2023-08-21 03:36:59
合計ジャッジ時間 6,772 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 740 ms
80,988 KB
testcase_01 AC 74 ms
71,540 KB
testcase_02 AC 73 ms
71,124 KB
testcase_03 AC 72 ms
71,564 KB
testcase_04 AC 76 ms
71,272 KB
testcase_05 AC 74 ms
71,496 KB
testcase_06 AC 72 ms
71,260 KB
testcase_07 AC 75 ms
71,052 KB
testcase_08 AC 88 ms
77,136 KB
testcase_09 AC 91 ms
76,860 KB
testcase_10 AC 74 ms
71,320 KB
testcase_11 AC 97 ms
80,092 KB
testcase_12 AC 196 ms
78,980 KB
testcase_13 AC 199 ms
79,032 KB
testcase_14 AC 199 ms
78,680 KB
testcase_15 AC 183 ms
79,028 KB
testcase_16 AC 195 ms
78,724 KB
testcase_17 AC 202 ms
78,948 KB
testcase_18 AC 199 ms
78,996 KB
testcase_19 AC 185 ms
79,328 KB
testcase_20 AC 201 ms
79,024 KB
testcase_21 AC 195 ms
78,692 KB
testcase_22 AC 703 ms
80,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate#,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys

setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())
ans=set()
d=set()
r=[]
info=[]
for i in range(n):
    a,b=input().split()
    info.append(b)
    d.add(a)
    ans.add(b)
for i in ans:
    if i not in d: r.append(i)
print(*sorted(r,key=lambda x: info.index(x) if x in info else float('inf')),sep="\n")
0