結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-20 00:49:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,784 KB
実行使用メモリ 76,640 KB
最終ジャッジ日時 2023-10-17 04:26:52
合計ジャッジ時間 4,333 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,604 KB
testcase_01 AC 31 ms
53,608 KB
testcase_02 AC 31 ms
53,604 KB
testcase_03 AC 110 ms
66,296 KB
testcase_04 AC 33 ms
53,612 KB
testcase_05 AC 43 ms
66,276 KB
testcase_06 AC 41 ms
65,656 KB
testcase_07 AC 41 ms
65,652 KB
testcase_08 AC 40 ms
64,236 KB
testcase_09 AC 42 ms
66,300 KB
testcase_10 AC 40 ms
63,604 KB
testcase_11 AC 49 ms
72,604 KB
testcase_12 AC 51 ms
72,512 KB
testcase_13 AC 120 ms
75,716 KB
testcase_14 WA -
testcase_15 AC 414 ms
76,640 KB
testcase_16 AC 99 ms
75,456 KB
testcase_17 AC 119 ms
75,712 KB
testcase_18 AC 480 ms
76,572 KB
testcase_19 AC 32 ms
53,608 KB
testcase_20 AC 30 ms
53,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i,d):
    p = dp = q = 0
    dq = 1<<i
    while d:
        np = 0
        for j,sj in enumerate(bin(dq)[:1:-1]):
            if sj=="1": np |= e[j]
        dp = np^p
        p = np
        if p == M: return 1
        d -= 1
        if d==0: break
        p,q,dp,dq = q,p,dq,dp

    return 0

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