結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー yaakiyuyaakiyu
提出日時 2023-12-02 16:06:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,720 KB
最終ジャッジ日時 2023-12-02 16:06:43
合計ジャッジ時間 3,710 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 80 ms
80,544 KB
testcase_02 AC 85 ms
82,864 KB
testcase_03 AC 82 ms
82,160 KB
testcase_04 AC 84 ms
81,904 KB
testcase_05 AC 87 ms
83,720 KB
testcase_06 AC 162 ms
77,156 KB
testcase_07 AC 140 ms
76,524 KB
testcase_08 AC 140 ms
76,524 KB
testcase_09 AC 142 ms
76,512 KB
testcase_10 AC 141 ms
76,636 KB
testcase_11 AC 41 ms
53,460 KB
testcase_12 AC 47 ms
62,200 KB
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 45 ms
62,208 KB
testcase_16 AC 40 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(1000000)

t = int(input())

for i in range(t):
    n, x = map(int, input().split())
    p = x - (n+1)*n//2
    if p < 0:
        print(-1)
    else:
        taseru = p//n
        amari = p%n
        #print(p, taseru, amari)
        print(*[i+taseru+(1 if amari >= (n-i+1) else 0) for i in range(1, n+1)][::-1])
0