結果

問題 No.839 Keep Distance and Nobody Explodes
ユーザー H3PO4H3PO4
提出日時 2021-02-21 09:50:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 42,460 KB
最終ジャッジ日時 2023-10-19 11:04:52
合計ジャッジ時間 19,958 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 506 ms
42,460 KB
testcase_01 AC 497 ms
42,460 KB
testcase_02 AC 492 ms
42,460 KB
testcase_03 AC 497 ms
42,460 KB
testcase_04 AC 492 ms
42,460 KB
testcase_05 AC 543 ms
42,460 KB
testcase_06 AC 537 ms
42,460 KB
testcase_07 AC 541 ms
42,460 KB
testcase_08 AC 538 ms
42,460 KB
testcase_09 AC 542 ms
42,460 KB
testcase_10 AC 538 ms
42,460 KB
testcase_11 AC 499 ms
42,460 KB
testcase_12 AC 511 ms
42,460 KB
testcase_13 AC 504 ms
42,460 KB
testcase_14 AC 499 ms
42,460 KB
testcase_15 AC 494 ms
42,460 KB
testcase_16 AC 494 ms
42,460 KB
testcase_17 AC 528 ms
42,460 KB
testcase_18 AC 499 ms
42,460 KB
testcase_19 AC 498 ms
42,460 KB
testcase_20 AC 520 ms
42,460 KB
testcase_21 AC 496 ms
42,460 KB
testcase_22 AC 523 ms
42,460 KB
testcase_23 AC 486 ms
42,460 KB
testcase_24 AC 517 ms
42,460 KB
testcase_25 AC 507 ms
42,460 KB
testcase_26 AC 497 ms
42,460 KB
testcase_27 AC 500 ms
42,460 KB
testcase_28 AC 499 ms
42,460 KB
testcase_29 AC 516 ms
42,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
odd = np.zeros(N, dtype=int)
odd[0] = 1
odd[-1] = N + 1
odd[1:N // 2] = np.arange(N + 3, 2 * N, 2)
odd[N // 2:-1] = np.arange(N - 1, 2, -2)

even = np.zeros(N, dtype=int)
even[:N // 2] = np.arange(N, 1, -2)
even[N // 2:] = np.arange(N + 2, 2 * N + 1, 2)

A = np.tile(np.arange(0, N * N, 2 * N), (N, 2)).T
A[:N//2] += odd
A[N//2:] += even
for a in A:
    print(*a)
0