結果

問題 No.2711 Connecting Lights
ユーザー umezoumezo
提出日時 2024-03-31 14:53:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 697 bytes
コンパイル時間 3,218 ms
コンパイル使用メモリ 244,968 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-03-31 14:54:09
合計ジャッジ時間 4,754 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 6 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 3 ms
6,676 KB
testcase_08 AC 4 ms
6,676 KB
testcase_09 AC 82 ms
6,676 KB
testcase_10 AC 54 ms
6,676 KB
testcase_11 AC 95 ms
7,680 KB
testcase_12 AC 27 ms
7,424 KB
testcase_13 AC 31 ms
8,192 KB
testcase_14 AC 6 ms
6,676 KB
testcase_15 AC 18 ms
6,676 KB
testcase_16 AC 6 ms
6,676 KB
testcase_17 AC 7 ms
7,424 KB
testcase_18 AC 7 ms
6,676 KB
testcase_19 AC 74 ms
6,784 KB
testcase_20 AC 34 ms
8,448 KB
testcase_21 AC 6 ms
6,912 KB
testcase_22 AC 4 ms
6,676 KB
testcase_23 AC 7 ms
8,320 KB
testcase_24 AC 50 ms
6,676 KB
testcase_25 AC 63 ms
6,676 KB
testcase_26 AC 140 ms
8,448 KB
testcase_27 AC 119 ms
8,448 KB
testcase_28 AC 138 ms
8,448 KB
testcase_29 AC 113 ms
8,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>; //B(n,V<int>(n))

ll dp[20020][32];
const int MOD=998244353;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  ll n,m,K;
  cin>>n>>m>>K;
  rep(j,1<<n) dp[0][j]=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 c=__builtin_popcount(k&j);
        if(c>=K) dp[i][k]=(dp[i][k]+dp[i-1][j])%MOD;
      }
    }
  }
  ll ans=0;
  rep(j,1<<n) ans=(ans+dp[m-1][j])%MOD;
  cout<<ans<<endl;
    
  return 0;
}
0