結果

問題 No.2711 Connecting Lights
ユーザー Nzt3Nzt3
提出日時 2024-03-31 14:28:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 573 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 203,700 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-31 14:28:43
合計ジャッジ時間 4,008 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 3 ms
6,676 KB
testcase_09 AC 67 ms
6,676 KB
testcase_10 AC 44 ms
6,676 KB
testcase_11 AC 98 ms
6,676 KB
testcase_12 AC 20 ms
6,676 KB
testcase_13 AC 23 ms
6,676 KB
testcase_14 AC 4 ms
6,676 KB
testcase_15 AC 13 ms
6,676 KB
testcase_16 AC 3 ms
6,676 KB
testcase_17 AC 3 ms
6,676 KB
testcase_18 AC 5 ms
6,676 KB
testcase_19 AC 62 ms
6,676 KB
testcase_20 AC 24 ms
6,676 KB
testcase_21 AC 3 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 3 ms
6,676 KB
testcase_24 AC 41 ms
6,676 KB
testcase_25 AC 52 ms
6,676 KB
testcase_26 AC 113 ms
6,676 KB
testcase_27 AC 99 ms
6,676 KB
testcase_28 AC 113 ms
6,676 KB
testcase_29 AC 92 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr int MOD=998244353;
void ch(ll &a,ll b){
  a=(a+b)%MOD;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,M,K;
  cin>>N>>M>>K;
  vector dp0(1<<N,1ll),dp1(1<<N,0ll);
  for(int i=1;i<M;i++){
    for(int j=0;j<1<<N;j++){
      for(int k=0;k<1<<N;k++){
        if(__builtin_popcount(j&k)>=K){
          ch(dp1[k],dp0[j]);
        }
      }
    }
    for(int j=0;j<1<<N;j++){
      dp0[j]=dp1[j];
      dp1[j]=0;
    }
  }
  ll ans=0;
  for(ll i:dp0)ch(ans,i);
  cout<<ans<<'\n';
}
0