結果

問題 No.3029 オイラー標数
ユーザー titia
提出日時 2025-02-27 02:19:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 701 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 65,240 KB
最終ジャッジ日時 2025-02-27 02:19:38
合計ジャッジ時間 17,547 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

Q=int(input())

V=set()
E=set()
F=set()

for i in range(Q):
    a,b,c=map(int,input().split())

    X=sorted([a,b,c])
    a,b,c=X

    V.add(a)
    V.add(b)
    V.add(c)

    E.add((a,b))
    E.add((a,c))
    E.add((b,c))

    F.add((a,b,c))

print(len(V)-len(E)+len(F))
0