結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー shin3110
提出日時 2023-12-02 14:41:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 3,025 bytes
コンパイル時間 4,822 ms
コンパイル使用メモリ 229,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-26 17:09:50
合計ジャッジ時間 5,394 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

/*
              ∧∧∩ 
             ( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!
               !!!!!!!!
             (
    o          (
           
             |      o
          (⌒ ⌒   /     
      ´⌒       
      '⌒ ;    ::⌒  
     ´          :::  
  ☆─ ´⌒;:    ::⌒` :;  
*/
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define elif else if
#define rep(i, s, n) for (int i=s; i<n; i++)
#define all(a) a.begin(), a.end()
// x2i01
#define bit(x,i)((x>>i)&1)
typedef long long ll;
typedef long double ld;
ld pi = 3.14159265358979;
inline void scan(){}
template<class Head,class... Tail>
inline void scan(Head&head,Tail&... tail){std::cin>>head;scan(tail...);}
// print(a, b, c) => cout << a << ' ' << b << ' ' << c << endl;
inline void print(){}
template<class Head,class... Tail>
inline void print(Head&head,Tail&... tail){std::cout<<head<<" ";print(tail...);cout<<endl;}
// bool"Yes", "No"
bool printb(bool f) {if (f) cout << "Yes\n";else cout << "No\n";return f;}
//vectorcout,cin
template<typename T>
std::istream &operator>>(std::istream&is,std::vector<T>&v){for(T &in:v){is>>in;}return is;}
template<typename T>
std::ostream &operator<<(std::ostream&os,const std::vector<T>&v){for(auto it=std::begin(v);it!=std::end(v);){os<<*it<<((++it)!=std::end(v)?" ":""
    );}return os;}
// 2(long double)
long double coor_dist(long double xi, long double yi, long double xj, long double yj) {
return sqrt(abs((xi - xj) * (xi - xj)) + abs((yi - yj) * (yi - yj)));
}
//
bool iskaibun(string s){ll k = s.size();rep(i,0,k/2){if(s[i]!=s[k-1-i]){return false;}}return true;}
template<class T> void chmax(T& a, T b) { if (a < b) a = b; }
template<class T> void chmin(T& a, T b) { if (a > b) a = b; }
#define mod 998244353
using mint = modint998244353;
int op(int a, int b) {return max(a, b);}
int e() {return 0;}
int mapping(int f, int x) {return (f == 1e9 ? x : f);}
int composition(int f, int g) {return (f == 1e9 ? g : f);}
int id() {return 1e9;}
signed main() {
cin.tie(nullptr);
cout << fixed << setprecision(10);
ios::sync_with_stdio(false);
int t; cin >> t;
while(t--) {
ll n, x; cin >> n >> x;
ll sum = (n+1)*n/2;
ll kari = (n-1)*n/2;
if(sum <= x) {
rep(i, 1, n) cout << i << ' ';
cout << x-kari << endl;
} else {
cout << -1 << endl;
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0