結果

問題 No.938 賢人を探せ
ユーザー otsuri_114514otsuri_114514
提出日時 2019-12-10 23:51:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 813 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 27,392 KB
最終ジャッジ日時 2023-09-06 07:56:06
合計ジャッジ時間 7,576 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

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