結果
問題 | No.1400 すごろくで世界旅行 |
ユーザー | convexineq |
提出日時 | 2021-02-20 00:29:02 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 801 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 81,768 KB |
実行使用メモリ | 77,744 KB |
最終ジャッジ日時 | 2023-10-17 03:37:36 |
合計ジャッジ時間 | 6,587 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
53,580 KB |
testcase_01 | AC | 35 ms
53,552 KB |
testcase_02 | AC | 34 ms
53,552 KB |
testcase_03 | RE | - |
testcase_04 | AC | 39 ms
53,560 KB |
testcase_05 | AC | 42 ms
61,584 KB |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | AC | 46 ms
63,640 KB |
testcase_10 | RE | - |
testcase_11 | AC | 48 ms
63,664 KB |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | TLE | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
ソースコード
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 def check2(i): p = 1<<i for _ in range(min(d,T)): np = 0 for j,sj in enumerate(bin(p)[:1:-1]): if sj=="1": np |= e[j] if np & MM: return 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(100,v)): c = check(i) if not c: print("No") exit() T = max(T,c) MM = (1<<min(100,v)) - 1 for i in range(100,v): if not check2(i,d-T): print("No") exit() print("Yes")