結果

問題 No.2711 Connecting Lights
ユーザー kusaf_kusaf_
提出日時 2024-04-03 22:01:19
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 4,165 ms
コンパイル使用メモリ 251,860 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-03 22:01:26
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge14 / 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 WA -
testcase_04 WA -
testcase_05 AC 4 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 3 ms
6,676 KB
testcase_08 AC 3 ms
6,676 KB
testcase_09 AC 71 ms
6,676 KB
testcase_10 AC 48 ms
6,676 KB
testcase_11 AC 83 ms
6,676 KB
testcase_12 AC 22 ms
6,676 KB
testcase_13 AC 27 ms
6,676 KB
testcase_14 AC 4 ms
6,676 KB
testcase_15 AC 14 ms
6,676 KB
testcase_16 AC 4 ms
6,676 KB
testcase_17 AC 4 ms
6,676 KB
testcase_18 AC 6 ms
6,676 KB
testcase_19 AC 67 ms
6,676 KB
testcase_20 AC 27 ms
6,676 KB
testcase_21 AC 4 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 4 ms
6,676 KB
testcase_24 AC 40 ms
6,676 KB
testcase_25 AC 53 ms
6,676 KB
testcase_26 AC 116 ms
6,676 KB
testcase_27 AC 103 ms
6,676 KB
testcase_28 AC 118 ms
6,676 KB
testcase_29 AC 96 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

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