結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-20 01:29:07
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 485 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,232 KB
最終ジャッジ日時 2023-10-17 06:01:18
合計ジャッジ時間 7,327 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,544 KB
testcase_01 AC 38 ms
53,548 KB
testcase_02 AC 39 ms
53,544 KB
testcase_03 AC 49 ms
63,724 KB
testcase_04 AC 39 ms
53,548 KB
testcase_05 AC 43 ms
59,424 KB
testcase_06 AC 61 ms
74,960 KB
testcase_07 AC 71 ms
74,992 KB
testcase_08 AC 48 ms
61,660 KB
testcase_09 AC 46 ms
61,656 KB
testcase_10 AC 52 ms
65,760 KB
testcase_11 AC 47 ms
61,660 KB
testcase_12 AC 118 ms
75,048 KB
testcase_13 AC 165 ms
76,532 KB
testcase_14 TLE -
testcase_15 AC 171 ms
76,504 KB
testcase_16 AC 134 ms
75,996 KB
testcase_17 AC 165 ms
76,576 KB
testcase_18 AC 163 ms
76,524 KB
testcase_19 AC 39 ms
53,584 KB
testcase_20 AC 39 ms
53,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    p = 0
    q = dq = 1<<i
    for k in range(d):
        np = p
        while dq:
            x = dq&-dq
            np |= e[x.bit_length()-1]
            dq -= x
        dq,q,p = np^p, np|p, q
        if q == M: return 1
    return 0

import sys
imput = sys.stdin.readline

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