結果

問題 No.2141 Enumeratest
ユーザー nyst
提出日時 2022-12-03 11:12:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 3,092 ms
コンパイル使用メモリ 171,864 KB
最終ジャッジ日時 2025-02-09 04:43:02
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <map>
#include <cmath>
#include <bitset>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <tuple>

#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;

using namespace std;

int main() {
    int n,m;
    cin >> n >> m;
    int div = m / n;
    int rest = m % n;
    vector<int> a(n,div);
    for(int i = 0;i<rest;i++) a[i]++;
    mint bunbo = 1,bunshi = 1;
    for(int i = 1;i<=m;i++) bunshi *= i;
    for(int i = 0;i<n;i++){
        if(a[i]==0) continue;
        for(int j =1;j<=a[i];j++) bunbo *= j;
    }
    mint ans = bunshi / bunbo;
    cout << ans.val() << endl;
}
0