結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー H3PO4H3PO4
提出日時 2022-04-23 09:23:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 968 ms / 3,153 ms
コード長 298 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 38,008 KB
最終ジャッジ日時 2023-09-07 01:32:38
合計ジャッジ時間 30,420 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
29,508 KB
testcase_01 AC 135 ms
29,452 KB
testcase_02 AC 131 ms
29,504 KB
testcase_03 AC 134 ms
29,376 KB
testcase_04 AC 133 ms
29,404 KB
testcase_05 AC 130 ms
29,508 KB
testcase_06 AC 131 ms
29,500 KB
testcase_07 AC 132 ms
29,356 KB
testcase_08 AC 137 ms
29,496 KB
testcase_09 AC 134 ms
29,496 KB
testcase_10 AC 133 ms
29,588 KB
testcase_11 AC 131 ms
29,356 KB
testcase_12 AC 133 ms
29,580 KB
testcase_13 AC 133 ms
29,440 KB
testcase_14 AC 132 ms
29,556 KB
testcase_15 AC 132 ms
29,536 KB
testcase_16 AC 134 ms
29,516 KB
testcase_17 AC 955 ms
36,972 KB
testcase_18 AC 942 ms
36,244 KB
testcase_19 AC 964 ms
37,240 KB
testcase_20 AC 939 ms
37,208 KB
testcase_21 AC 942 ms
37,112 KB
testcase_22 AC 968 ms
38,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def solve(V: int, D: int):
    if D == 1:
        return np.ones((V, V), dtype=int)
    else:
        res = np.zeros((V, V), dtype=int)
        res[0, :] = 1
        res[:, 0] = 1
        return res


res = solve(*map(int, input().split()))
for x in res:
    print(*x, sep="")
0