結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー CecilCecil
提出日時 2023-12-02 15:19:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 426 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2023-12-02 15:19:10
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 157 ms
14,336 KB
testcase_02 AC 183 ms
15,104 KB
testcase_03 AC 156 ms
16,640 KB
testcase_04 AC 182 ms
15,760 KB
testcase_05 AC 191 ms
16,128 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 67 ms
10,368 KB
testcase_12 AC 71 ms
10,368 KB
testcase_13 AC 70 ms
10,368 KB
testcase_14 AC 70 ms
10,368 KB
testcase_15 AC 70 ms
10,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
for _ in range(t):
    n,x = map(int, input().split())
    s = x
    f = True
    ans = [0]*n
    for i in range(1, n):
        #print(s, i)
        if s > ans[i-2]:
            ans[i-1] = i
            s -= i
        else:
            f = False
    if s > ans[-2]:
        ans[-1] = s
        s = 0
    else:
        f = False
    #print(ans)
    if f == True:
        print(*ans)
    else:
        print(-1)
0