結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー ragnaragna
提出日時 2023-09-27 23:31:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 854 bytes
コンパイル時間 1,448 ms
コンパイル使用メモリ 167,280 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-18 15:30:29
合計ジャッジ時間 3,415 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 13 ms
6,676 KB
testcase_02 AC 15 ms
6,676 KB
testcase_03 AC 13 ms
6,676 KB
testcase_04 AC 16 ms
6,676 KB
testcase_05 AC 17 ms
6,676 KB
testcase_06 AC 133 ms
6,676 KB
testcase_07 AC 132 ms
6,676 KB
testcase_08 AC 134 ms
6,676 KB
testcase_09 AC 131 ms
6,676 KB
testcase_10 AC 131 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 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rrep(i,a,b) for(ll i=(ll)(a-1);i>=(ll)(b);i--)
#define MOD 998244353
//#define MOD 1000000007
#define INF 1e18
#define Pair pair<ll,ll>
//#define PI numbers::pi
//#define E numbers::e
template <typename T> bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
ll dx[8]={-2,-1,1,2,-2,-1,1,2};
ll dy[8]={-1,-2,-2,-1,1,2,2,1};

int main(){
    ll t; cin >> t;
    assert(1<=t&&t<=1e5);
    while(t--){
        ll n,x; cin >> n >> x;
        assert(1<=n&&n<=2e5);
        assert(1<=x&&x<=1e18);
        if(x<n*(n+1)/2) cout << -1 << endl;
        else{
            rep(i,0,n-1) cout << i+1 << ' ';
            cout << x-(n-1)*n/2 << endl;
        }
    }
}
0