結果

問題 No.1400 すごろくで世界旅行
ユーザー ytoki28ytoki28
提出日時 2021-02-20 00:03:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 277 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,772 KB
実行使用メモリ 51,780 KB
最終ジャッジ日時 2023-10-17 01:47:34
合計ジャッジ時間 18,655 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 467 ms
42,576 KB
testcase_01 AC 464 ms
42,576 KB
testcase_02 AC 467 ms
42,576 KB
testcase_03 AC 483 ms
42,576 KB
testcase_04 AC 466 ms
42,576 KB
testcase_05 AC 469 ms
42,576 KB
testcase_06 AC 583 ms
42,576 KB
testcase_07 AC 690 ms
43,256 KB
testcase_08 AC 482 ms
42,576 KB
testcase_09 AC 478 ms
42,576 KB
testcase_10 AC 513 ms
42,576 KB
testcase_11 AC 473 ms
42,576 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

readline = sys.stdin.readline
read = sys.stdin.read

v, d = map(int, readline().split())
a = [list(map(int,readline().rstrip('\n'))) for i in range(v)]
a = np.array(a)
ans = "Yes" if np.all(np.linalg.matrix_power(a,min(d,v))) else "No"
print(ans)
0