結果

問題 No.1400 すごろくで世界旅行
ユーザー convexineqconvexineq
提出日時 2021-02-19 22:57:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 167,716 KB
最終ジャッジ日時 2023-10-15 04:11:36
合計ジャッジ時間 9,180 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
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 WA -
testcase_14 OLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    p = 1<<i
    for _ in range(min(d,4001)):
        np = 0
        for j,sj in enumerate(bin(p)[:1:-1]):
            print(j,sj)
            if sj=="1": np |= e[j]
        if np == M: return True
        p = np
    return False

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