結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー ちーぴんちーぴん
提出日時 2023-12-02 16:44:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 83,320 KB
最終ジャッジ日時 2023-12-02 16:44:29
合計ジャッジ時間 4,202 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 75 ms
80,276 KB
testcase_02 AC 84 ms
82,368 KB
testcase_03 AC 77 ms
81,204 KB
testcase_04 AC 79 ms
81,948 KB
testcase_05 AC 94 ms
83,320 KB
testcase_06 AC 311 ms
78,036 KB
testcase_07 AC 312 ms
77,660 KB
testcase_08 AC 310 ms
77,136 KB
testcase_09 AC 333 ms
77,984 KB
testcase_10 AC 312 ms
77,288 KB
testcase_11 AC 36 ms
53,332 KB
testcase_12 AC 43 ms
62,356 KB
testcase_13 AC 34 ms
53,332 KB
testcase_14 AC 33 ms
53,332 KB
testcase_15 AC 42 ms
62,352 KB
testcase_16 AC 35 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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