結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー neon_trd06neon_trd06
提出日時 2022-11-25 21:36:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 1,591 ms
コンパイル使用メモリ 162,424 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 02:49:37
合計ジャッジ時間 5,356 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 2 ms
6,940 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,m;
    cin >> n >> m ;
    if(n<m){
        cout << 0 << endl;
        return 0 ;
    }
    long long ans = 1 ; 
    for(long long i = m ; i<n ; i++){
        long long k = 1 ;
        long long l = 1 ; 
        for(long long j = i ; 1<=j ; j--)k*=j;
        for(long long t = n ; (n-i)<=t ; t--)l*=t;
        ans+=(l/k);
        ans%=998244353;
    }
    cout << ans << endl;
}
0