結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー LevyxLevyx
提出日時 2023-12-02 16:38:16
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 932 bytes
コンパイル時間 5,165 ms
コンパイル使用メモリ 310,012 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-12-02 16:38:27
合計ジャッジ時間 6,766 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
6,548 KB
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#include <atcoder/all>
using namespace atcoder;
using mint1 = modint1000000007;
using mint2 = modint998244353;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ld pi=3.141592653589793;
const int inf=2e9;
const ll linf=2e18;
const ld eps=1e-14;
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl

int main() {
    ll t;
    cin >> t;
    while(t--) {
        ll n,x;
        cin >> n >> x;
        if((2*x-n*n+3*n)%(2*n)!=0) {
            cout << -1 << endl;
        }else {
            vector<ll> ans;
            for(ll i=0; i<n; i++) {
                ans.push_back((2*x-n*n+3*n)/(2*n)+i-1);
            }
            reverse(ans.begin(),ans.end());
            for(ll i=0; i<n; i++) {
                cout << ans[i] << " ";
            }
            cout << endl;
        }
    }
}
0