結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-20 01:39:19
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 483 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 77,880 KB
最終ジャッジ日時 2023-10-17 06:10:21
合計ジャッジ時間 6,790 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,540 KB
testcase_01 AC 37 ms
53,544 KB
testcase_02 AC 37 ms
53,540 KB
testcase_03 AC 47 ms
63,740 KB
testcase_04 AC 37 ms
53,544 KB
testcase_05 AC 42 ms
59,440 KB
testcase_06 AC 56 ms
73,560 KB
testcase_07 AC 67 ms
75,004 KB
testcase_08 AC 45 ms
61,676 KB
testcase_09 AC 45 ms
61,672 KB
testcase_10 AC 48 ms
65,776 KB
testcase_11 AC 44 ms
61,676 KB
testcase_12 AC 114 ms
75,064 KB
testcase_13 AC 161 ms
76,568 KB
testcase_14 TLE -
testcase_15 AC 166 ms
76,524 KB
testcase_16 AC 131 ms
76,024 KB
testcase_17 AC 160 ms
76,604 KB
testcase_18 AC 156 ms
76,552 KB
testcase_19 AC 36 ms
53,576 KB
testcase_20 AC 37 ms
53,580 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, 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