結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー lloyzlloyz
提出日時 2023-12-18 00:03:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 2,354 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 83,324 KB
最終ジャッジ日時 2023-12-18 00:03:57
合計ジャッジ時間 7,139 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 84 ms
80,388 KB
testcase_02 AC 88 ms
82,596 KB
testcase_03 AC 83 ms
81,184 KB
testcase_04 AC 89 ms
81,948 KB
testcase_05 AC 91 ms
83,324 KB
testcase_06 AC 150 ms
76,936 KB
testcase_07 AC 160 ms
76,680 KB
testcase_08 AC 148 ms
76,688 KB
testcase_09 AC 150 ms
76,668 KB
testcase_10 AC 145 ms
76,820 KB
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 48 ms
62,344 KB
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 47 ms
62,348 KB
testcase_16 AC 38 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

for _ in range(int(input())):
    n, x = map(int, input().split())
    min_ = n * (n + 1) // 2
    if x < min_:
        print(-1)
        continue
    d = x - min_
    q, r = divmod(d, n)
    ANS = [n - i for i in range(n)]
    for i in range(n):
        if i < r:
            ANS[i] += q + 1
        else:
            ANS[i] += q
    print(*ANS)
0