結果

問題 No.2711 Connecting Lights
ユーザー a01sa01toa01sa01to
提出日時 2024-03-31 14:25:10
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 894 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 252,036 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-31 14:25:18
合計ジャッジ時間 5,583 ms
ジャッジサーバーID
(参考情報)
judge10 / 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 WA -
testcase_04 WA -
testcase_05 AC 5 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 4 ms
6,676 KB
testcase_09 AC 156 ms
6,676 KB
testcase_10 AC 52 ms
6,676 KB
testcase_11 AC 92 ms
6,676 KB
testcase_12 AC 38 ms
6,676 KB
testcase_13 AC 32 ms
6,676 KB
testcase_14 AC 5 ms
6,676 KB
testcase_15 AC 33 ms
6,676 KB
testcase_16 AC 5 ms
6,676 KB
testcase_17 AC 6 ms
6,676 KB
testcase_18 AC 7 ms
6,676 KB
testcase_19 AC 74 ms
6,676 KB
testcase_20 AC 47 ms
6,676 KB
testcase_21 AC 5 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 4 ms
6,676 KB
testcase_24 AC 87 ms
6,676 KB
testcase_25 AC 121 ms
6,676 KB
testcase_26 AC 266 ms
6,676 KB
testcase_27 AC 156 ms
6,676 KB
testcase_28 AC 266 ms
6,676 KB
testcase_29 AC 108 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

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