結果
問題 | No.1989 Pairing Multiset |
ユーザー |
|
提出日時 | 2025-01-15 17:00:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 2,570 ms |
コンパイル使用メモリ | 192,248 KB |
実行使用メモリ | 11,608 KB |
最終ジャッジ日時 | 2025-01-15 17:00:26 |
合計ジャッジ時間 | 4,740 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d%d", &n, &m); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using LL = long long;const int N = 2e6 + 7;const int MOD = 998244353;int inv[N];int main() {inv[1] = 1;for(int i = 2; i < N; ++i)inv[i] = MOD - 1LL * MOD / i * inv[MOD % i] % MOD;int n, m;scanf("%d%d", &n, &m);int ans = n;for(int i = 1; i <= 2 * n + 1; ++i)ans = 1LL * ans * inv[i] % MOD * (2 * n + m - i + 1) % MOD;printf("%d\n", ans);return 0;}