結果
問題 |
No.2560 A_1 < A_2 < ... < A_N
|
ユーザー |
|
提出日時 | 2023-12-07 20:12:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 1,808 ms |
コンパイル使用メモリ | 169,168 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-09-27 02:19:51 |
合計ジャッジ時間 | 3,386 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 RE * 5 |
ソースコード
// 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"; } }