結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-19 23:13:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 76,344 KB
最終ジャッジ日時 2023-10-16 22:52:33
合計ジャッジ時間 4,596 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 35 ms
53,540 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 35 ms
53,548 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 273 ms
76,344 KB
testcase_14 WA -
testcase_15 AC 145 ms
75,688 KB
testcase_16 WA -
testcase_17 AC 274 ms
76,344 KB
testcase_18 AC 1,209 ms
76,196 KB
testcase_19 AC 34 ms
53,544 KB
testcase_20 AC 34 ms
53,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    p = 1<<i
    for _ in range(min(d,4001)):
        np = j = 0
        while p:
            if p&1: np |= e[j]
            p >>= 1
        if np == M: return True
        p = np
    return False

import sys
input = sys.stdin.readline
v,d = map(int,input().split())
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