結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー achapiachapi
提出日時 2023-12-02 14:44:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 2,173 ms
コンパイル使用メモリ 203,560 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 14:44:12
合計ジャッジ時間 4,233 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 15 ms
6,676 KB
testcase_02 AC 16 ms
6,676 KB
testcase_03 AC 14 ms
6,676 KB
testcase_04 AC 16 ms
6,676 KB
testcase_05 AC 17 ms
6,676 KB
testcase_06 AC 135 ms
6,676 KB
testcase_07 AC 133 ms
6,676 KB
testcase_08 AC 139 ms
6,676 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 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;
int main(){
	int T;
	cin >> T;
	while (T--){
		int N;
		long long X;
		cin >> N >> X;
		vector<long long> ans(N);
		for (int i = 0; i < N - 1; i++){
			ans[i] = i + 1;
			X -= i + 1;
		}
		if (ans[N - 2] < X){
			ans[N - 1] = X;
			for (int i = 0; i < N; i++){
				cout << ans[i];
				if (i + 1 < N){
					cout << ' ';
				}
			}
			cout << endl;
		} else {
			cout << -1 << endl;
		}
	}
}
0