結果
問題 | No.2130 分配方法の数え上げ mod 998244353 |
ユーザー |
|
提出日時 | 2022-11-25 21:21:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 625 ms |
コンパイル使用メモリ | 68,128 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-02 03:49:51 |
合計ジャッジ時間 | 1,604 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() | ^~~~
ソースコード
#include<iostream> #include<atcoder/modint> using namespace std; using mint=atcoder::modint998244353; long N; int M; main() { cin>>N>>M; mint ans=mint(2).pow(N); mint C=1; for(int i=0;i<M;i++) { ans-=C; C=C*(N-i)/(i+1); } cout<<ans.val()<<endl; }