結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー 👑 tipstar0125tipstar0125
提出日時 2023-12-07 14:39:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 88,068 KB
最終ジャッジ日時 2023-12-07 14:39:54
合計ジャッジ時間 4,955 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 87 ms
83,232 KB
testcase_02 AC 94 ms
86,100 KB
testcase_03 AC 90 ms
88,068 KB
testcase_04 AC 93 ms
87,356 KB
testcase_05 AC 97 ms
87,952 KB
testcase_06 AC 336 ms
77,176 KB
testcase_07 AC 337 ms
77,284 KB
testcase_08 AC 320 ms
77,216 KB
testcase_09 AC 316 ms
77,096 KB
testcase_10 AC 339 ms
77,812 KB
testcase_11 AC 39 ms
53,460 KB
testcase_12 AC 48 ms
62,344 KB
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 47 ms
62,352 KB
testcase_16 AC 38 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())

for _ in range(T):
    N,X=list(map(int, input().split()))
    s=(1+N)*N//2
    if s>X:
        print(-1)
        continue
    x=(X-s)//N
    r=X-(s+x*N)
    ans=[]
    for i in range(N,0,-1):
        a=i+x
        if r>0:
            a+=1
            r-=1
        ans.append(a)
    print(*ans)
0