結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー tonegawatonegawa
提出日時 2023-12-03 13:14:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 505 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2023-12-03 13:14:16
合計ジャッジ時間 5,065 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,856 KB
testcase_01 AC 121 ms
14,464 KB
testcase_02 AC 135 ms
15,232 KB
testcase_03 AC 122 ms
16,640 KB
testcase_04 AC 141 ms
15,932 KB
testcase_05 AC 147 ms
16,128 KB
testcase_06 AC 495 ms
9,984 KB
testcase_07 AC 496 ms
9,984 KB
testcase_08 AC 501 ms
9,984 KB
testcase_09 AC 498 ms
9,984 KB
testcase_10 AC 505 ms
9,984 KB
testcase_11 AC 29 ms
9,984 KB
testcase_12 AC 28 ms
9,984 KB
testcase_13 AC 27 ms
9,984 KB
testcase_14 AC 27 ms
9,856 KB
testcase_15 AC 29 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
  n, x = map(int, input().split())
  if n * (n + 1) // 2 > x:
    print(-1)
    return

  ans = []
  for i in range(0, n):
    if i == n - 1:
      ans.append(x)
    else:
      ans.append(i + 1)
      x -= i + 1
  print(*ans)



t = int(input())
for i in range(t):
  solve()
0