結果

問題 No.1169 Row and Column and Diagonal
ユーザー syunsukesyunsuke
提出日時 2020-09-13 20:49:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 79,648 KB
最終ジャッジ日時 2023-09-03 23:58:01
合計ジャッジ時間 3,494 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,164 KB
testcase_01 AC 70 ms
71,364 KB
testcase_02 AC 71 ms
70,988 KB
testcase_03 AC 71 ms
71,332 KB
testcase_04 AC 72 ms
71,304 KB
testcase_05 AC 70 ms
71,304 KB
testcase_06 AC 85 ms
76,712 KB
testcase_07 AC 92 ms
77,672 KB
testcase_08 AC 96 ms
77,800 KB
testcase_09 AC 100 ms
78,232 KB
testcase_10 AC 109 ms
79,024 KB
testcase_11 AC 110 ms
79,476 KB
testcase_12 AC 112 ms
79,648 KB
testcase_13 AC 112 ms
79,512 KB
testcase_14 AC 115 ms
79,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

L=[[0 for i in range(N)]for j in range(N)]
L[0][0]=1
for i in range(1,N):
    L[0][i]=(L[0][i-1]+2)%N
    if L[0][i]==0:
        L[0][i]=N
#print(L)
for i in range(1,N):
    for j in range(N):
        L[i][j]=(L[i-1][j]+N-1)%N
        if L[i][j]==0:
            L[i][j]=N
#print(L)
for i in range(N):
    print(*L[i])
0