結果
問題 | No.2560 A_1 < A_2 < ... < A_N |
ユーザー | SyimP |
提出日時 | 2023-12-02 19:24:26 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,547 bytes |
コンパイル時間 | 1,485 ms |
コンパイル使用メモリ | 171,248 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-26 21:30:36 |
合計ジャッジ時間 | 2,689 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 24 ms
5,376 KB |
testcase_07 | AC | 24 ms
5,376 KB |
testcase_08 | AC | 24 ms
5,376 KB |
testcase_09 | AC | 24 ms
5,376 KB |
testcase_10 | AC | 25 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #include <iomanip> #define rep(i,n) for (int i = (int)(0); i < (int)(n); i++) #define rep1(i,n) for (int i = (int)(1); i <= (int)(n); i++) #define REP(i,s,n) for (int i = (int)(s); i < (int)(n); i++) #define mrep(i,s,n) for (int i = (int)(s) - 1; i >= (int)(n); i--) #define fore(i,a) for(auto &i:a) #define all(c) begin(c), end(c) #define rall(x) x.rbegin(), x.rend() #define vcsort(x) sort(all(x)) #define rev(x) reverse(all(x)) #define vcerase(x) x.erase(unique(all(x)),x.end()) #define vcsum(x) accumulate(all(x),0) #define vcmax(x) *max_element(all(x)) #define vcmin(x) *min_element(all(x)) #define FI first #define SE second #define pb(x) push_back(x) #define ppb(x) pop_back(X) #define EL '\n' #define v(type, name, ...) vector<type> name(__VA_ARGS__) #define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) //#define print(x) cout << x << "\n"; //----- using namespace std; using ll = long long; using Ul = unsigned long long; using cl = const ll; using VI = vector<int>; using VS = vector<string>; using VC = vector<char>; using VL = vector<ll>; using VB = vector<bool>; using PI = pair<int, int>; using PL = pair<ll, ll>; using SI = set<int>; using MII = map<int, int>; using MIS = map<int, string>; using MSI = map<string, int>; template<class t> using V = vector<t>; template< typename T > //vector<int> a(n); cin >> a; ostream &operator<<(ostream &os, const vector< T > &v) { for(int i = 0; i < (int) v.size(); i++) { os << v[i] << (i + 1 != (int) v.size() ? " " : ""); } return os; } template< typename T > istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; } //-tekito- int GCD(int a, int b) {if(b == 0){return a;}return GCD(b,a % b);}//最大公約数 int LCM(int a, int b) {return a/GCD(a, b)*b;}//最小公倍数 ll llsm1(ll n) { return (n * (n + 1)) / 2; }//1~nの総和 int kaijo(int n) {if(n==0||n==1){return 1;}else{return n*kaijo(n - 1);}}//階乗 int ketaSum(int num) {int digit_sum=0;while(num>0){digit_sum+=num%10;num/=10;}return digit_sum;}//各桁の和 string revstr(const string& str) {string reversed=str;reverse(reversed.begin(),reversed.end());return reversed;}//文字列反転 bool isPrime(int n) {if(n<2){return false;}for(int i=2;i*i<=n;i++){if(n%i==0){return false;}}return true;} int getNthPrime(int n) {std::vector<bool> isPrime(1e7, true);isPrime[0] = isPrime[1] = false;int count = 0; int prime = 2;while (count < n) {if (isPrime[prime]) {count++;if (count == n)break;for (int i = prime * 2; i < 1e7; i += prime)isPrime[i] = false;}prime++;}return prime;} long long ppow(int base, int exponent) {long long result=1;while(exponent>0){if(exponent%2==1){result*=base;}base*=base;exponent/=2;}return result;} char getAlp(int a) {if(a>0||a<27){return'A'+a-1;}} char getalp(int a) {if(a>0||a<27){return'a'+a-1;}} int getAlpin(char a) {if(a>='A'||a<='Z'){return a-64;}} int getalpin(char a) {if(a>='a'||a<='z'){return a-96;}} template<class t,class u> bool chmax(t&a,u b) {if(a<b){a=b;return true;}else return false;} template<class t,class u> bool chmin(t&a,u b) {if(b<a){a=b;return true;}else return false;} //-io- void fix(int a){cout << fixed << setprecision(a);} void ent() { cout << "\n";}//print() void OYN(bool a){cout << (a ? "YES" : "NO") << "\n";} void Oyn(bool a){cout << (a ? "Yes" : "No") << "\n";} void oyn(bool a){cout << (a ? "yes" : "no") << "\n";} const string YESNO[2] = {"NO", "YES"};//上 const string YesNo[2] = {"No", "Yes"}; const string yesno[2] = {"no", "yes"}; void print() { cout << '\n'; } template<typename T>//print(a,b,c,...) void print(const T &t) { cout << t << '\n'; } template<typename Head, typename... Tail> void print(const Head &head, const Tail &... tail) { cout << head << ' '; print(tail...); } //----- const int MOD = 998244353; //1+119×2^23 const int INF = 1e9+7; //-search- using Graph = vector<vector<int>>; int dx[8]={1,0,-1,0,1,1,-1,-1}; int dy[8]={0,-1,0,1,-1,1,1,-1}; /*↓↓↓ CODES ↓↓↓*/ /*cin してないやつは愚か*/ int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t; cin >> t; rep(i,t){ int n,x; cin >> n >> x; int sum = ((1 + (n-1))*(n-1))/2; if(x - sum >= n){ rep(i,n-1){ cout << (i+1) << " "; } cout << x - sum << EL; }else cout << -1 << EL; } }