結果

問題 No.1169 Row and Column and Diagonal
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-04 15:45:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 86,644 KB
実行使用メモリ 79,296 KB
最終ジャッジ日時 2023-09-26 23:46:50
合計ジャッジ時間 4,029 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,900 KB
testcase_01 AC 72 ms
71,272 KB
testcase_02 AC 76 ms
71,136 KB
testcase_03 AC 73 ms
71,064 KB
testcase_04 AC 74 ms
71,204 KB
testcase_05 AC 72 ms
71,260 KB
testcase_06 AC 87 ms
76,244 KB
testcase_07 AC 92 ms
77,404 KB
testcase_08 AC 96 ms
77,572 KB
testcase_09 AC 100 ms
78,016 KB
testcase_10 AC 110 ms
78,924 KB
testcase_11 AC 112 ms
79,260 KB
testcase_12 AC 112 ms
79,112 KB
testcase_13 AC 116 ms
79,256 KB
testcase_14 AC 117 ms
79,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = [[0]*n for i in range(n)]
for i in range(n):
    for j in range(n):
        x = 2*(i+1)-(j+1)
        if x%n != 0:
            ans[i][j] = x%n
        else:
            ans[i][j] = n        
for i in range(n):
    print(*ans[i])
0