結果
| 問題 | No.2948 move move rotti |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-25 22:41:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 474 bytes |
| 記録 | |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 52,736 KB |
| 最終ジャッジ日時 | 2026-05-05 21:50:08 |
| 合計ジャッジ時間 | 3,478 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 10 |
ソースコード
n,m,k=map(int,input().split())
x=list(map(int,input().split()))
a=[[] for i in range(n)]
for i in range(m):
s,t=map(int,input().split())
a[s-1].append(t-1)
a[t-1].append(s-1)
y=[0 for i in range(n)]
now={x[0]-1}
used={x[0]-1}
c=1
while now:
new=set()
for i in now:
for j in a[i]:
if j not in used:
new.add(j)
used.add(j)
y[j]=c
now=new
c+=1
for i in x:
if i-1 not in used:
print('No')
exit()
if y[i-1]%2!=0:
print('No')
exit()
print('Yes')