結果
問題 |
No.2948 move move rotti
|
ユーザー |
![]() |
提出日時 | 2024-07-03 06:56:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 175 ms |
コンパイル使用メモリ | 82,028 KB |
実行使用メモリ | 87,460 KB |
最終ジャッジ日時 | 2024-07-03 06:56:52 |
合計ジャッジ時間 | 5,946 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 27 |
ソースコード
import sys sys.setrecursionlimit(100000) import pypyjit pypyjit.set_param('max_unroll_recursion=-1') n,m,k=map(int,input().split()) x=0 for i in map(int,input().split()):x|=1<<(int(i)-1) con=[[] for _ in range(n)] for i in range(m): u,v=map(int,input().split()) con[u-1].append(v-1) con[v-1].append(u-1) possible=[0]*(1<<n) visited=0 def dfs(now): global visited possible[visited]^=1<<now visited^=1<<now for nex in con[now]: if not (visited>>nex)&1: dfs(nex) visited^=1<<now for i in range(n): dfs(i) for j in possible: #print(format(j,'06b')) if j|x==j: print("Yes") exit() possible=[0]*(1<<n) print("No")