結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー shisidor
提出日時 2023-12-02 15:29:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 73,520 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-26 18:45:48
合計ジャッジ時間 2,545 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 5
権限があれば一括ダウンロードができます

ソースコード

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 i = 1; i <= n - 1; i++) cout << i << " ";
            cout << n + d << endl;
        }
        else cout << -1 << endl;
    }
}
0