結果

問題 No.3275 Minesweeper on Graph
ユーザー miztom
提出日時 2025-09-19 23:20:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 76,612 KB
最終ジャッジ日時 2025-09-19 23:20:18
合計ジャッジ時間 6,518 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
A=[*map(int,input().split())]
g=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    g[a-1]|=1<<b-1;g[b-1]|=1<<a-1
for i in range(1<<n):
    if all((i&g[j]).bit_count()==A[j]for j in range(n)):exit(print("Yes")or print(*f"{i:0{n}b}"[::-1]))
print("No")
0