結果

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

ソースコード

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",*f"{i:0{n}b}"[::-1]))
print("No")
0