結果

問題 No.2560 A_1 < A_2 < ... < A_N
コンテスト
ユーザー mitani
提出日時 2024-03-31 08:38:44
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 495 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,758 ms
コンパイル使用メモリ 243,840 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-16 19:57:15
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(x) x.begin(), x.end()
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#include <atcoder/all>
using namespace atcoder;
//using mint=static_modint<998244353>;
using mint=static_modint<1000000007>;

void solve(){
	ll n,x;cin>>n>>x;
	if(n*(n+1)>x*2){
		cout<<-1<<endl;
		return;
	}
	rep(i,n-1)cout<<i+1<<" ";
	cout<<x-n*(n-1)/2<<endl;
}

int main(){
	ll t;cin>>t;
	rep(i,t)solve();
}
0