結果

問題 No.942 プレゼント配り
ユーザー maspymaspy
提出日時 2019-12-05 00:10:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,864 KB
最終ジャッジ日時 2024-05-08 12:28:17
合計ジャッジ時間 3,364 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 29 ms
10,496 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 29 ms
10,624 KB
testcase_11 AC 29 ms
10,624 KB
testcase_12 AC 29 ms
10,752 KB
testcase_13 AC 29 ms
10,624 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 29 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K = map(int,readline().split())

if N % (K * 2) != 0:
    print('No')
    exit()

A = list(range(1,N+1))
M = N // 2
pairs = ['{} {}'.format(x,y) for x,y in zip(A[:M], A[M:][::-1])]

size = M // K
for i in range(K):
    print(' '.join(pairs[i*size:i*size+size]))
0