結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-12-02 14:35:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,948 KB
最終ジャッジ日時 2023-12-02 14:35:46
合計ジャッジ時間 4,172 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,608 KB
testcase_01 AC 94 ms
80,864 KB
testcase_02 AC 95 ms
82,960 KB
testcase_03 AC 78 ms
81,820 KB
testcase_04 AC 80 ms
82,888 KB
testcase_05 AC 84 ms
83,948 KB
testcase_06 AC 159 ms
77,556 KB
testcase_07 AC 155 ms
78,080 KB
testcase_08 AC 155 ms
78,208 KB
testcase_09 AC 154 ms
77,936 KB
testcase_10 AC 160 ms
78,248 KB
testcase_11 AC 42 ms
57,704 KB
testcase_12 AC 50 ms
66,540 KB
testcase_13 AC 41 ms
57,704 KB
testcase_14 AC 49 ms
55,608 KB
testcase_15 AC 48 ms
64,436 KB
testcase_16 AC 45 ms
57,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

def answer():
    N,X = map(int,input().split())
    if N*(N+1)//2 >X:
        print(-1)
        return
    
    res = X - N*(N+1)//2
    base,p = divmod(res,N)
    ans = [base + N-i for i in range(N)]
    for j in range(p):
        ans[j] += 1
    print(*ans)
for _ in range(int(input())):
    answer()
0