結果
| 問題 | No.2206 Popcount Sum 2 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-08-02 16:27:01 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 2,002 ms |
| コンパイル使用メモリ | 330,176 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-13 18:46:59 |
| 合計ジャッジ時間 | 11,291 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 3 TLE * 1 -- * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int test,n,m,fac[200010],inv[100010],inve[100010];
const int P=998244353;
int main()
{
scanf("%d",&test);
for(;test--;)
{
scanf("%d%d",&n,&m);
fac[0]=fac[1]=inv[1]=inve[0]=inve[1]=1;
for(int i=2;i<=n;i++)
{
fac[i]=1LL*fac[i-1]*i%P;
inv[i]=1LL*(P-P/i)*inv[P%i]%P;
inve[i]=1LL*inve[i-1]*inv[i]%P;
}
int sum=0;
for(int i=0;i<m;i++) sum=(sum+1LL*fac[n-1]*inve[i]%P*inve[n-i-1]%P)%P;
int ans=1;
for(int i=1;i<=n;i++) ans=ans*2%P;
ans=(ans-1+P)%P;
printf("%lld\n",1LL*sum*ans%P);
}
return 0;
}
vjudge1