結果
問題 |
No.2560 A_1 < A_2 < ... < A_N
|
ユーザー |
![]() |
提出日時 | 2023-12-03 18:04:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 572 bytes |
コンパイル時間 | 480 ms |
コンパイル使用メモリ | 40,900 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 22:12:37 |
合計ジャッジ時間 | 1,576 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
/* -*- coding: utf-8 -*- * * 2560.cc: No.2560 A_1 < A_2 < ... < A_N - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { int n; ll x; scanf("%d%lld", &n, &x); if ((ll)n * (n + 1) / 2 > x) { puts("-1"); continue; } for (int i = 1; i < n; i++) printf("%d ", i); printf("%lld\n", x - (ll)n * (n - 1) / 2); } return 0; }