結果

問題 No.938 賢人を探せ
ユーザー tails1434tails1434
提出日時 2019-12-25 21:30:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 613 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 1,523 ms
コンパイル使用メモリ 86,504 KB
実行使用メモリ 81,796 KB
最終ジャッジ日時 2023-08-21 03:42:15
合計ジャッジ時間 6,851 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 613 ms
81,392 KB
testcase_01 AC 71 ms
71,204 KB
testcase_02 AC 71 ms
71,028 KB
testcase_03 AC 71 ms
71,176 KB
testcase_04 AC 75 ms
71,360 KB
testcase_05 AC 72 ms
71,364 KB
testcase_06 AC 74 ms
71,316 KB
testcase_07 AC 72 ms
71,420 KB
testcase_08 AC 114 ms
78,224 KB
testcase_09 AC 113 ms
78,844 KB
testcase_10 AC 74 ms
71,152 KB
testcase_11 AC 116 ms
79,640 KB
testcase_12 AC 135 ms
78,628 KB
testcase_13 AC 131 ms
78,928 KB
testcase_14 AC 135 ms
78,624 KB
testcase_15 AC 132 ms
78,732 KB
testcase_16 AC 134 ms
78,404 KB
testcase_17 AC 134 ms
78,740 KB
testcase_18 AC 134 ms
78,628 KB
testcase_19 AC 132 ms
78,552 KB
testcase_20 AC 133 ms
78,732 KB
testcase_21 AC 130 ms
78,776 KB
testcase_22 AC 562 ms
81,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    students = set()
    cheeters = set()
    others = []
    for i in range(N):
        A, B = input().split()
        cheeters.add(A)
        others.append(B)
        students.add(A)
        students.add(B)

    honests = students ^ cheeters
    ans = []
    for name in others:
        if name in honests:
            if not name in ans:
                ans.append(name)

    for a in ans:
        print(a)
    

    
    


if __name__ == "__main__":
    main()
0