結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー KoiKoi
提出日時 2023-12-02 14:55:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 92,256 KB
最終ジャッジ日時 2023-12-02 14:55:37
合計ジャッジ時間 3,984 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 98 ms
86,908 KB
testcase_02 AC 106 ms
89,532 KB
testcase_03 AC 104 ms
90,092 KB
testcase_04 AC 105 ms
88,084 KB
testcase_05 AC 108 ms
92,256 KB
testcase_06 AC 208 ms
85,748 KB
testcase_07 AC 211 ms
86,192 KB
testcase_08 AC 207 ms
85,624 KB
testcase_09 AC 205 ms
85,624 KB
testcase_10 AC 194 ms
85,576 KB
testcase_11 AC 40 ms
53,460 KB
testcase_12 AC 71 ms
77,136 KB
testcase_13 AC 64 ms
75,736 KB
testcase_14 AC 65 ms
76,284 KB
testcase_15 AC 71 ms
76,664 KB
testcase_16 AC 68 ms
75,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
answers=[]
for _ in range(T):
    N,X=map(int,input().split())
    ans=[]
    for i in range(N):
        l=N-i
        s=(X+l*(l-1)//2)
        if(s%l==0):
            ans.append(s//l)
            X-=s//l
        else:
            ans.append(s//l+1)
            X-=s//l+1
    if(min(ans)<1):
        answers.append([-1])
    else:
        answers.append(ans)
for ans in answers:
    print(*ans)
        
0