結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー suminoeno7suminoeno7
提出日時 2023-12-02 15:30:46
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 125,828 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 15:30:50
合計ジャッジ時間 3,633 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 121 ms
6,676 KB
testcase_07 AC 126 ms
6,676 KB
testcase_08 AC 137 ms
6,676 KB
testcase_09 AC 128 ms
6,676 KB
testcase_10 AC 128 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;

int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        int n, x;
        cin >> n >> x;
        int d = x - (long long)n * (n + 1) / 2;
        if (d >= 0) {
            for (int j = 1; j <= n - 1; j++) cout << j << " ";
            cout << n + d << endl;
        }
        else cout << -1 << endl;
    }
}
0