結果

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

ソースコード

diff #

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

#include <atcoder/modint>
using mint = atcoder::modint998244353;
void operator<<(ostream& os, const mint& m) { os << m.val(); }

#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector dp(m, vector<mint>(1 << n));
  rep(i, 1 << n) if (popcount(ull(i)) >= k) dp[0][i] = 1;
  rep(i, m - 1) {
    rep(prevbit, 1 << n) {
      rep(nextbit, 1 << n) {
        if (popcount(ull(nextbit)) < k) continue;
        if (popcount(ull(prevbit & nextbit)) < k) continue;
        dp[i + 1][nextbit] += dp[i][prevbit];
      }
    }
  }
  Debug(dp);
  mint ans = 0;
  rep(i, 1 << n) ans += dp[m - 1][i];
  cout << ans.val() << endl;
  return 0;
}
0