結果
問題 | No.2560 A_1 < A_2 < ... < A_N |
ユーザー |
|
提出日時 | 2023-12-02 15:11:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 579 bytes |
コンパイル時間 | 3,401 ms |
コンパイル使用メモリ | 245,780 KB |
最終ジャッジ日時 | 2025-02-18 04:19:31 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>#include <bits/extc++.h>using i64 = long long;using i128 = __int128_t;void solve(){i64 n, x;std::cin >> n >> x;i64 check = (n - 1) * (n + 2) / 2;if (check >= x){std::cout << "-1\n";return;}i64 S = n * (n - 1) / 2;i64 r = x - S;for (int i = 1; i <= n - 1; i++){std::cout << i << ' ';}std::cout << r << '\n';}int main(){std::cin.tie(nullptr)->sync_with_stdio(false);int t;std::cin >> t;while (t--){solve();}return 0;}