結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineq
提出日時 2021-02-19 22:48:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 83,292 KB
最終ジャッジ日時 2024-09-16 21:21:01
合計ジャッジ時間 6,372 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 1 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
v,d = map(int,input().split())
e = [int(input(),2) for _ in range(v)]
M = (1<<v) - 1
for i in range(v):
    p = 1<<i
    for _ in range(min(d,4001)):
        np = 0
        for j in range(v):
            if p>>j&1: np |= e[j]
        p = np
    if p != M:
        print("No")
        exit()
print("Yes")
0