結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー Ayush RawatAyush Rawat
提出日時 2023-12-07 20:12:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 659 bytes
コンパイル時間 1,712 ms
コンパイル使用メモリ 170,080 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-07 20:13:02
合計ジャッジ時間 3,852 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 19 ms
6,676 KB
testcase_02 AC 23 ms
6,676 KB
testcase_03 AC 20 ms
6,676 KB
testcase_04 AC 23 ms
6,676 KB
testcase_05 AC 25 ms
6,676 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 3 ms
6,676 KB
testcase_12 AC 3 ms
6,676 KB
testcase_13 AC 3 ms
6,676 KB
testcase_14 AC 3 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// C++ Program to find sum of Fibonacci numbers in 
// O(Log n) time.
#include <bits/stdc++.h>
using namespace std;
const long long MAX = LLONG_MAX;


// Driver program to test above function
int main()
{
	int t;
	cin>>t;
	while(t--){
		long long n,x;
		cin>>n>>x;
		vector<long long >ans;
		long long sum = 0;
		for(int i=1; i<=x; i++){
			if(n == 1){
				if(x-sum>ans.back()){
					ans.push_back(x-sum);
					n--;
				}
				break;
			}
			sum+=i;
			ans.push_back(i);
			n--;
		}
		// cout<<ans.size()<<" " <<n<<endl;
		if(n){
			cout<<-1<<"\n";
			continue;
		}
		for(auto i: ans)
			cout<<i<<" ";
		cout<<"\n";
	}
}
0