結果

問題 No.839 Keep Distance and Nobody Explodes
ユーザー maspymaspy
提出日時 2020-03-13 23:17:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 595 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 47,948 KB
最終ジャッジ日時 2024-05-02 10:42:49
合計ジャッジ時間 19,113 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 536 ms
44,100 KB
testcase_01 AC 535 ms
44,612 KB
testcase_02 AC 529 ms
44,352 KB
testcase_03 AC 534 ms
44,232 KB
testcase_04 AC 536 ms
44,616 KB
testcase_05 AC 591 ms
47,936 KB
testcase_06 AC 592 ms
47,176 KB
testcase_07 AC 585 ms
47,948 KB
testcase_08 AC 594 ms
47,560 KB
testcase_09 AC 595 ms
47,296 KB
testcase_10 AC 586 ms
47,040 KB
testcase_11 AC 544 ms
43,844 KB
testcase_12 AC 545 ms
44,232 KB
testcase_13 AC 541 ms
43,844 KB
testcase_14 AC 540 ms
44,100 KB
testcase_15 AC 530 ms
43,972 KB
testcase_16 AC 535 ms
44,228 KB
testcase_17 AC 579 ms
46,924 KB
testcase_18 AC 527 ms
44,100 KB
testcase_19 AC 527 ms
43,972 KB
testcase_20 AC 564 ms
46,028 KB
testcase_21 AC 541 ms
44,224 KB
testcase_22 AC 570 ms
46,664 KB
testcase_23 AC 538 ms
44,620 KB
testcase_24 AC 559 ms
45,896 KB
testcase_25 AC 544 ms
44,236 KB
testcase_26 AC 546 ms
43,972 KB
testcase_27 AC 538 ms
44,488 KB
testcase_28 AC 543 ms
44,364 KB
testcase_29 AC 563 ms
45,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3.8
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


# %%
import numpy as np

# %%
N = int(read())

# %%
M = N // 2
A = np.empty((N, N), np.int32)
A[:M, :M] = np.arange(1, N * N // 2, 2).reshape(M, M)
A[M:, M:] = np.arange(2, N * N // 2 + 1, 2).reshape(M, M)
A[:M, M:] = np.arange(N * N // 2 + 1, N * N, 2).reshape(M, M)[:,::-1]
A[M:, :M] = np.arange(N * N // 2 + 2, N * N + 1, 2).reshape(M, M)[:,::-1]


# %%
print('\n'.join(' '.join(row) for row in A.astype(str)))
0