結果
問題 |
No.2910 単体ホモロジー入門
|
ユーザー |
![]() |
提出日時 | 2024-10-04 22:05:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,440 ms / 2,000 ms |
コード長 | 813 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 77,788 KB |
最終ジャッジ日時 | 2024-10-04 22:05:34 |
合計ジャッジ時間 | 27,178 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 47 |
ソースコード
import sys input = sys.stdin.readline from random import choice,randint N,M=map(int,input().split()) E=[[] for i in range(N)] for i in range(M): x,y=map(int,input().split()) E[x].append(y) E[y].append(x) X=list(map(int,input().split())) X.sort() X=tuple(X) SET=set() for i in range(10**5): A=[randint(0,N-1)] flag=0 while flag<100 and len(A)<=5: if E[A[-1]]==[]: break to=choice(E[A[-1]]) if to==A[0] and len(A)>=3: SET.add(tuple(sorted(A))) break else: if to in A: flag+=1 continue else: A.append(to) flag=0 continue SET.discard(X) if len(SET)>0: print("Yes") else: print("No")