結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー tonegawatonegawa
提出日時 2023-12-03 13:12:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2023-12-03 13:12:44
合計ジャッジ時間 4,918 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,856 KB
testcase_01 AC 127 ms
14,464 KB
testcase_02 AC 140 ms
15,232 KB
testcase_03 AC 116 ms
16,640 KB
testcase_04 AC 139 ms
15,932 KB
testcase_05 AC 142 ms
16,128 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 28 ms
9,984 KB
testcase_12 AC 28 ms
9,984 KB
testcase_13 AC 28 ms
9,984 KB
testcase_14 AC 28 ms
9,856 KB
testcase_15 AC 32 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

  ans = [1]
  x -= 1
  for i in range(1, 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