結果
問題 |
No.2711 Connecting Lights
|
ユーザー |
![]() |
提出日時 | 2024-03-31 13:43:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 545 bytes |
コンパイル時間 | 1,887 ms |
コンパイル使用メモリ | 194,300 KB |
最終ジャッジ日時 | 2025-02-20 16:29:21 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 2 |
ソースコード
#include<bits/stdc++.h> #include<atcoder/modint> using namespace std; using mint=atcoder::modint998244353; int N,M,K; mint dp[20202][32]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>M>>K; dp[0][(1<<N)-1]=1; for(int i=1;i<=M;i++)for(int j=0;j<(1<<N);j++) { for(int k=0;k<(1<<N);k++) { int both=(j&k); if(__builtin_popcount(both)>=K)dp[i][k]+=dp[i-1][j]; } } mint ans=0; for(int j=0;j<(1<<N);j++)ans+=dp[M][j]; cout<<ans.val()<<endl; }