結果

問題 No.1400 すごろくで世界旅行
ユーザー takelifetimetakelifetime
提出日時 2021-02-19 21:54:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 209 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 40,964 KB
最終ジャッジ日時 2023-10-15 01:14:01
合計ジャッジ時間 12,571 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
29,644 KB
testcase_01 AC 137 ms
29,736 KB
testcase_02 AC 137 ms
29,800 KB
testcase_03 AC 151 ms
30,068 KB
testcase_04 AC 138 ms
29,756 KB
testcase_05 AC 139 ms
29,672 KB
testcase_06 AC 259 ms
31,244 KB
testcase_07 AC 433 ms
32,592 KB
testcase_08 AC 151 ms
30,040 KB
testcase_09 AC 149 ms
29,980 KB
testcase_10 AC 174 ms
30,308 KB
testcase_11 AC 153 ms
29,980 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
v, d = map(int, input().split())
e = np.array([list(map(int, list(input()))) for _ in range(v)], dtype=np.int64)
e_d = np.linalg.matrix_power(e, d)
print("Yes" if np.all(e_d != 0) else "No")
0