結果

問題 No.1989 Pairing Multiset
ユーザー ygd.ygd.
提出日時 2022-06-25 10:00:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,291 ms / 2,000 ms
コード長 1,134 bytes
コンパイル時間 10,552 ms
コンパイル使用メモリ 471,692 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 16:01:59
合計ジャッジ時間 27,514 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,275 ms
6,816 KB
testcase_01 AC 1,282 ms
6,816 KB
testcase_02 AC 1,282 ms
6,944 KB
testcase_03 AC 1,291 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1,278 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 1,202 ms
6,944 KB
testcase_09 AC 48 ms
6,940 KB
testcase_10 AC 425 ms
6,940 KB
testcase_11 AC 784 ms
6,944 KB
testcase_12 AC 855 ms
6,944 KB
testcase_13 AC 1,249 ms
6,940 KB
testcase_14 AC 205 ms
6,944 KB
testcase_15 AC 172 ms
6,940 KB
testcase_16 AC 1,072 ms
6,940 KB
testcase_17 AC 92 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 164 ms
6,940 KB
testcase_20 AC 1,275 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG //遅い可能性がある 
#include <bits/stdc++.h>
#include<atcoder/all>
#include<boost/multiprecision/cpp_int.hpp> //多倍長
using namespace boost::multiprecision; // 多倍長.型はcpp_int
using namespace atcoder;
using namespace std;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(),(a).end() //lower_bound(ALL(a),x)
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;

ll MOD = 998244353;
int INF = 100100100;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};

int depth[110000];
int mxdepth[110000];

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
  	if (a == 0) return 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}



int main() {
    int N,M;
    cin >> N >> M;
    ll ans = N;
    ll n = 2*N+M;
    ll k = 2*N+1;
    rep(i,k){
        ll temp = (n-i) * modpow(i+1,MOD-2,MOD);
        ans *= temp%MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


0