結果
| 問題 | 
                            No.3029 オイラー標数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-02-21 21:32:57 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 463 ms / 2,000 ms | 
| コード長 | 595 bytes | 
| コンパイル時間 | 218 ms | 
| コンパイル使用メモリ | 82,324 KB | 
| 実行使用メモリ | 153,536 KB | 
| 最終ジャッジ日時 | 2025-02-21 21:33:09 | 
| 合計ジャッジ時間 | 11,649 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 27 | 
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
q = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
#    alist.append(list(map(int,input().split())))
v = set()
e = set()
f = set()
for i in range(q):
    a,b,c = map(int,input().split())
    v.add(a)
    v.add(b)
    v.add(c)
    e.add((a,b))
    e.add((b,c))
    e.add((a,c))
    f.add((a,b,c))
print(len(v) - len(e) + len(f))