結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー kinoko_econkinoko_econ
提出日時 2023-12-02 16:41:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,176 KB
最終ジャッジ日時 2023-12-02 16:41:44
合計ジャッジ時間 4,587 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,332 KB
testcase_01 AC 87 ms
80,120 KB
testcase_02 AC 93 ms
82,200 KB
testcase_03 AC 88 ms
81,028 KB
testcase_04 AC 108 ms
81,296 KB
testcase_05 AC 96 ms
83,176 KB
testcase_06 AC 299 ms
76,464 KB
testcase_07 AC 312 ms
76,956 KB
testcase_08 AC 325 ms
76,320 KB
testcase_09 AC 297 ms
76,192 KB
testcase_10 AC 299 ms
76,488 KB
testcase_11 AC 41 ms
53,332 KB
testcase_12 AC 49 ms
62,216 KB
testcase_13 AC 41 ms
53,332 KB
testcase_14 AC 38 ms
53,332 KB
testcase_15 AC 49 ms
62,220 KB
testcase_16 AC 46 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for t in range(T):
    N, X = map(int,input().split())
    if X < N*(N+1)//2:
        print(-1)
    else:
        tmp = X - N*(N+1)//2
        a = [0]*N 
        for i in range(N):
            if i < tmp%N:
                a[i] = (N-i) + tmp//N + 1 
            else:
                a[i] = (N-i) + tmp//N
        print(*a)
0