結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー titiatitia
提出日時 2021-02-19 22:40:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 288 ms / 3,153 ms
コード長 347 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 16,048 KB
最終ジャッジ日時 2023-10-15 03:32:56
合計ジャッジ時間 22,433 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,848 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 14 ms
7,832 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 14 ms
7,860 KB
testcase_05 AC 15 ms
7,816 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 15 ms
7,940 KB
testcase_09 AC 15 ms
7,768 KB
testcase_10 AC 15 ms
7,960 KB
testcase_11 AC 14 ms
7,800 KB
testcase_12 AC 14 ms
7,820 KB
testcase_13 AC 14 ms
7,820 KB
testcase_14 AC 15 ms
7,952 KB
testcase_15 AC 16 ms
7,852 KB
testcase_16 AC 15 ms
7,860 KB
testcase_17 AC 249 ms
15,872 KB
testcase_18 AC 258 ms
16,048 KB
testcase_19 AC 250 ms
15,940 KB
testcase_20 AC 259 ms
15,860 KB
testcase_21 AC 258 ms
15,916 KB
testcase_22 AC 288 ms
15,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

V,D=map(int,input().split())

E=[[0]*V for i in range(V)]

if D==1:    
    for i in range(V):
        for j in range(V):
                E[i][j]=1

else:
    for i in range(V):
        for j in range(V):
            if i==0 or j==0:
                E[i][j]=1

for ans in E:
    print("".join(map(str,ans)))
0