結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-19 23:08:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 399 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 81,752 KB
実行使用メモリ 81,944 KB
最終ジャッジ日時 2023-10-16 22:21:09
合計ジャッジ時間 7,353 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
60,532 KB
testcase_01 AC 37 ms
53,520 KB
testcase_02 AC 34 ms
53,516 KB
testcase_03 AC 47 ms
64,220 KB
testcase_04 AC 35 ms
53,520 KB
testcase_05 AC 42 ms
62,168 KB
testcase_06 AC 60 ms
72,768 KB
testcase_07 AC 64 ms
75,396 KB
testcase_08 AC 47 ms
64,216 KB
testcase_09 AC 46 ms
63,600 KB
testcase_10 AC 49 ms
68,316 KB
testcase_11 AC 45 ms
63,596 KB
testcase_12 AC 96 ms
75,384 KB
testcase_13 AC 180 ms
76,692 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

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

v,d = map(int,input().split())
e = [int(input(),2) for _ in range(v)][::-1]
M = (1<<v) - 1
for i in range(v):
    if not check(i):
        print("No")
        exit()
print("Yes")
0