結果

問題 No.1169 Row and Column and Diagonal
ユーザー arahi10arahi10
提出日時 2020-08-14 22:20:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 14,028 KB
最終ジャッジ日時 2023-07-31 22:53:22
合計ジャッジ時間 2,956 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 16 ms
7,776 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 15 ms
7,804 KB
testcase_05 AC 15 ms
7,892 KB
testcase_06 AC 29 ms
8,244 KB
testcase_07 AC 50 ms
8,812 KB
testcase_08 AC 73 ms
9,076 KB
testcase_09 AC 104 ms
10,064 KB
testcase_10 AC 182 ms
12,924 KB
testcase_11 AC 199 ms
13,632 KB
testcase_12 AC 212 ms
13,912 KB
testcase_13 AC 210 ms
13,988 KB
testcase_14 AC 215 ms
14,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ans=[[0]*n for i in range(n)]
for i in range(n):
    ans[i][i]=i+1
    x,y=i,i
    for j in range(n):
        x,y=(x-1)%n,(y+1)%n
        ans[x][y]=i+1
for a in ans:print(*a)
0