結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,984 KB
testcase_01 AC 154 ms
14,464 KB
testcase_02 AC 175 ms
15,232 KB
testcase_03 AC 149 ms
16,768 KB
testcase_04 AC 174 ms
15,896 KB
testcase_05 AC 195 ms
16,256 KB
testcase_06 AC 596 ms
10,112 KB
testcase_07 AC 583 ms
10,112 KB
testcase_08 AC 591 ms
10,112 KB
testcase_09 AC 602 ms
10,112 KB
testcase_10 AC 589 ms
10,112 KB
testcase_11 AC 68 ms
10,368 KB
testcase_12 AC 65 ms
10,368 KB
testcase_13 AC 64 ms
10,368 KB
testcase_14 AC 65 ms
10,496 KB
testcase_15 AC 69 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
    if n == 1:
        print(x)
        continue
    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