結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー 👑 kakel-sankakel-san
提出日時 2023-12-02 14:41:27
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,068 bytes
コンパイル時間 8,562 ms
コンパイル使用メモリ 158,892 KB
実行使用メモリ 182,704 KB
最終ジャッジ日時 2023-12-02 14:41:39
合計ジャッジ時間 11,642 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
32,804 KB
testcase_01 AC 137 ms
42,532 KB
testcase_02 AC 104 ms
45,604 KB
testcase_03 AC 99 ms
46,372 KB
testcase_04 AC 103 ms
47,140 KB
testcase_05 AC 103 ms
47,140 KB
testcase_06 AC 134 ms
55,972 KB
testcase_07 AC 128 ms
55,972 KB
testcase_08 AC 126 ms
56,100 KB
testcase_09 AC 125 ms
56,100 KB
testcase_10 AC 139 ms
56,100 KB
testcase_11 AC 75 ms
35,108 KB
testcase_12 AC 77 ms
35,108 KB
testcase_13 AC 76 ms
35,108 KB
testcase_14 AC 78 ms
35,108 KB
testcase_15 AC 73 ms
182,704 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (88 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        var ans = new List<string>();
        for (var u = 0; u < t; ++u)
        {
            var c = ReadLine().Split();
            var n = int.Parse(c[0]);
            var x = long.Parse(c[1]);
            var min = new long[n];
            for (var i = 0; i < n; ++i) min[i] = i + 1;
            var sum = min.Sum();
            if (x < sum)
            {
                ans.Add("-1");
            }
            else
            {
                min[^1] += x - sum;
                ans.Add(string.Join(" ", min));
            }
        }
        WriteLine(string.Join("\n", ans));
    }
}
0