結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー oharu
提出日時 2023-12-03 15:52:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 1,689 ms
コンパイル使用メモリ 165,668 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-26 22:11:19
合計ジャッジ時間 3,273 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

long long f(int n){
    long long m=n;
    return m*(m-1)/2;
}
 
int main(){
    int t;cin>>t;
    rep(i,t){
        int n;long long x;cin>>n>>x;
        x-=f(n);
        if(x>=n){
            rep(j,n){
                if(j!=n-1){cout<<(j+1)<<' ';}
                else{cout<<x<<endl;}
            }
        }
        else{
            cout<<-1<<endl;
        }
    }
}
0