結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー Today03
提出日時 2023-12-02 19:42:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 552 bytes
コンパイル時間 2,325 ms
コンパイル使用メモリ 194,256 KB
最終ジャッジ日時 2025-02-18 06:15:41
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#if __has_include("./debug.cpp")
#include "./debug.cpp"
#else
#define debug(...)
#define print_line
#endif
using namespace std;
using ll = long long;

void solve() {
	int N;
	ll X;
	cin >> N >> X;
	if (X < 1ll * N * (N + 1) / 2) {
		cout << "-1\n";
		return;
	}

	vector<ll> ans;
	for (int i = 0; i < N - 1; i++) ans.push_back(i + 1);
	ans.push_back(X - 1ll * (N - 1) * N / 2);
	for (int i = 0; i < N; i++) cout << ans[i] << ' ';
	cout << '\n';
}

int main() {
	int T;
	cin >> T;
	for (int i = 0; i < T; i++) {
		solve();
	}
}
0