結果

問題 No.2711 Connecting Lights
ユーザー kusaf_
提出日時 2024-04-03 22:01:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 2,977 ms
コンパイル使用メモリ 252,108 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-01 00:07:00
合計ジャッジ時間 4,787 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll N, M, K;
  cin >> N >> M >> K;

  vector<vector<mint>> dp(M + 1, vector<mint>(1 << N, 0));
  dp[0].back() = 1;

  for(ll i = 0; i < M; i++) {
    for(ll j = 0; j < 1 << N; j++) {
      for(ll k = 0; k < 1 << N; k++) {
        unsigned b = j & k;
        if(popcount(b) >= K) { dp[i + 1][k] += dp[i][j]; }
      }
    }
  }

  cout << accumulate(dp[M].begin(), dp[M].end(), mint(0)).val() << "\n";
}
0