結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-19 22:58:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 78,212 KB
最終ジャッジ日時 2023-10-15 04:14:14
合計ジャッジ時間 6,056 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,328 KB
testcase_01 AC 72 ms
71,316 KB
testcase_02 AC 72 ms
71,516 KB
testcase_03 AC 83 ms
76,608 KB
testcase_04 WA -
testcase_05 AC 78 ms
75,880 KB
testcase_06 AC 89 ms
76,156 KB
testcase_07 AC 95 ms
76,788 KB
testcase_08 AC 83 ms
76,396 KB
testcase_09 AC 83 ms
75,852 KB
testcase_10 AC 86 ms
76,336 KB
testcase_11 AC 81 ms
75,832 KB
testcase_12 AC 121 ms
76,924 KB
testcase_13 AC 189 ms
77,948 KB
testcase_14 WA -
testcase_15 AC 621 ms
77,916 KB
testcase_16 AC 129 ms
77,216 KB
testcase_17 AC 187 ms
78,000 KB
testcase_18 AC 827 ms
77,680 KB
testcase_19 AC 73 ms
71,300 KB
testcase_20 AC 77 ms
71,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    p = 1<<i
    for _ in range(min(d,4001)):
        np = 0
        for j,sj in enumerate(bin(p)[:1:-1]):
            if sj=="1": np |= e[j]
        if np == M: return True
        p = np
    return False

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):
    if not check(i):
        print("No")
        exit()
print("Yes")
0