結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー suminoeno7
提出日時 2023-12-02 15:30:46
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 2,075 ms
コンパイル使用メモリ 133,868 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-26 18:49:03
合計ジャッジ時間 3,952 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 j = 1; j <= n - 1; j++) cout << j << " ";
            cout << n + d << endl;
        }
        else cout << -1 << endl;
    }
}
0