結果
問題 | No.2567 A_1 > A_2 > ... > A_N |
ユーザー |
|
提出日時 | 2023-12-02 16:38:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 149 ms / 2,000 ms |
コード長 | 2,378 bytes |
コンパイル時間 | 935 ms |
コンパイル使用メモリ | 100,172 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 20:32:18 |
合計ジャッジ時間 | 3,602 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 16 |
ソースコード
//(・ω・)#include <stdio.h>#include <iostream> // cout, endl, cin#include <string> // string, to_string, atoi#include <vector> // vector#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound#include <utility> // pair, make_pair#include <tuple> // tuple, make_tuple#include <cstdint> // int64_t, int*_t#include <cstdio> // printf#include <map> // map#include <queue> // queue, priority_queue#include <set> // set#include <stack> // stack#include <deque> // deque#include <unordered_map> // unordered_map#include <unordered_set> // unordered_set#include <bitset> // bitset#include <cctype> // isupper, islower, isdigit, toupper, tolower#include <math.h>#include <iomanip> //setprecision#include <limits>#include <sstream> //istringstream#include <stdlib.h>#include <list>#include <iterator>//std::advance()using namespace std;using ll = long long;using ull = unsigned long long;using ld = long double;#define SZ(x) ((int)(x).size());#define vec vectortemplate <class T>using v = vector<T>;template <class T>using vv = v< v<T> >;template <class T>using vvv = v< vv<T> >;#define el '\n'#define vl v<ll>#define vvl vv<ll>#define pl pair<ll, ll>#define repab(i, a, b) for(ll i = a; i < (ll)(b); ++i)#define rep(i, n) for(ll i = 0; i < (ll)(n); ++i)#define rep1(i, n) for(ll i = 1; i <= (ll)(n); ++i)#define rrep(i, n) for(ll i = ((ll)(n) - 1); i >= 0; --i)#define rrep1(i, n) for(ll i = ((ll)(n)); i > 0; --i)#define YN(x) cout << ((x) ? "YES\n" : "NO\n");#define Yn(x) cout << ((x) ? "Yes\n" : "No\n");#define yn(x) cout << ((x) ? "yes\n" : "no\n");#define COUT(x) cout << (x) << el;const double pi = 3.141592653589793238;const int inf = 1073741823;const ll infl = 1LL << 60;ll gcd(ll a, ll b){return b ? gcd(b, a % b) : a;}int dx[4] = {1, 0, -1, 0};int dy[4] = {0, 1, 0, -1};int main(){ll t;cin >> t;rep(i, t){ll n,x;cin >> n >> x;if(x < n * (n + 1) / 2){cout << -1 << endl;}else{ll diff = x - n * (n + 1) / 2;//差ll diffplus = diff / n;ll diffhani = diff % n;rep(j, n){if(j <= diffhani - 1) cout << (n - j + diffplus + 1) << " ";else cout << n - j + diffplus << " ";}cout << endl;}}return 0;}