結果
問題 |
No.2560 A_1 < A_2 < ... < A_N
|
ユーザー |
|
提出日時 | 2023-12-02 14:38:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 679 bytes |
コンパイル時間 | 1,912 ms |
コンパイル使用メモリ | 193,516 KB |
最終ジャッジ日時 | 2025-02-18 03:44:18 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 WA * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ ll n, x; cin >> n >> x; if(n * (n + 1) <= 2 * x){ vector<int> ans(n); iota(ans.begin(), ans.end(), 1); ans.back() = x - n * (n - 1) / 2; cout << ans << '\n'; }else{ cout << -1 << '\n'; } } }