結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-20 00:36:51
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,825 ms / 3,153 ms
コード長 479 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 76,980 KB
最終ジャッジ日時 2023-10-17 03:52:36
合計ジャッジ時間 6,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,532 KB
testcase_01 AC 36 ms
53,536 KB
testcase_02 AC 35 ms
53,532 KB
testcase_03 AC 40 ms
59,504 KB
testcase_04 AC 35 ms
53,536 KB
testcase_05 AC 40 ms
59,500 KB
testcase_06 AC 42 ms
59,508 KB
testcase_07 AC 43 ms
61,548 KB
testcase_08 AC 39 ms
59,496 KB
testcase_09 AC 40 ms
59,504 KB
testcase_10 AC 41 ms
59,504 KB
testcase_11 AC 39 ms
59,504 KB
testcase_12 AC 51 ms
63,768 KB
testcase_13 AC 133 ms
75,692 KB
testcase_14 AC 1,825 ms
76,980 KB
testcase_15 AC 526 ms
76,568 KB
testcase_16 AC 110 ms
75,428 KB
testcase_17 AC 134 ms
75,660 KB
testcase_18 AC 822 ms
76,496 KB
testcase_19 AC 35 ms
53,532 KB
testcase_20 AC 34 ms
53,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    p = 1<<i
    for k in range(d):
        np = 0
        for j,sj in enumerate(bin(p)[:1:-1]):
            if sj=="1": np |= e[j]
        if np == M: return k+1
        p = np
    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
T = 0
for i in range(min(10,v)):
    c = check(i)
    if c==0:
        print("No")
        exit()
    T = max(T,c)
print("Yes")
0