結果

問題 No.1400 すごろくで世界旅行
ユーザー takelifetimetakelifetime
提出日時 2021-02-19 21:45:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 225 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 96,808 KB
最終ジャッジ日時 2023-10-15 00:41:08
合計ジャッジ時間 12,678 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
29,692 KB
testcase_01 AC 137 ms
29,568 KB
testcase_02 AC 134 ms
29,608 KB
testcase_03 AC 147 ms
30,044 KB
testcase_04 AC 135 ms
29,644 KB
testcase_05 AC 135 ms
29,736 KB
testcase_06 AC 253 ms
31,488 KB
testcase_07 AC 428 ms
33,036 KB
testcase_08 AC 153 ms
30,076 KB
testcase_09 AC 150 ms
29,924 KB
testcase_10 AC 175 ms
30,404 KB
testcase_11 AC 146 ms
29,888 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 len(e_d[e_d.nonzero()]) == v * v else "No")
0