結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー ngng628ngng628
提出日時 2023-12-02 14:46:13
言語 Crystal
(1.11.2)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 15,511 ms
コンパイル使用メモリ 290,392 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2023-12-02 14:46:31
合計ジャッジ時間 14,670 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 9 ms
6,548 KB
testcase_02 AC 12 ms
7,168 KB
testcase_03 AC 11 ms
7,168 KB
testcase_04 AC 11 ms
6,676 KB
testcase_05 AC 13 ms
7,168 KB
testcase_06 AC 134 ms
6,676 KB
testcase_07 AC 134 ms
6,676 KB
testcase_08 AC 135 ms
6,676 KB
testcase_09 AC 135 ms
6,676 KB
testcase_10 AC 135 ms
6,676 KB
testcase_11 AC 3 ms
6,676 KB
testcase_12 AC 3 ms
6,676 KB
testcase_13 AC 4 ms
6,676 KB
testcase_14 AC 3 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = read_line.to_i64
t.times do
  n, x = read_line.split.map &.to_i64
  a = [*(1_i64..n)]
  if a.sum <= x
    a[-1] += x - a.sum
    puts a.join ' '
  else
    puts -1
  end
end
0