結果

問題 No.839 Keep Distance and Nobody Explodes
コンテスト
ユーザー maspy
提出日時 2020-03-13 23:13:29
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 546 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 524 ms
コンパイル使用メモリ 20,952 KB
実行使用メモリ 38,884 KB
最終ジャッジ日時 2026-05-16 21:43:04
合計ジャッジ時間 18,989 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/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)
A[M:, :M] = np.arange(N * N // 2 + 2, N * N + 1, 2).reshape(M, M)


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