結果

問題 No.2711 Connecting Lights
ユーザー startcppstartcpp
提出日時 2024-03-31 13:42:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 884 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 90,904 KB
実行使用メモリ 28,636 KB
最終ジャッジ日時 2024-03-31 13:42:38
合計ジャッジ時間 1,934 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
28,636 KB
testcase_01 AC 9 ms
28,636 KB
testcase_02 AC 9 ms
28,636 KB
testcase_03 AC 8 ms
28,636 KB
testcase_04 AC 9 ms
28,636 KB
testcase_05 AC 10 ms
28,636 KB
testcase_06 AC 8 ms
28,636 KB
testcase_07 AC 8 ms
28,636 KB
testcase_08 AC 7 ms
28,636 KB
testcase_09 AC 21 ms
28,636 KB
testcase_10 AC 8 ms
28,636 KB
testcase_11 AC 10 ms
28,636 KB
testcase_12 AC 10 ms
28,636 KB
testcase_13 AC 9 ms
28,636 KB
testcase_14 AC 8 ms
28,636 KB
testcase_15 AC 11 ms
28,636 KB
testcase_16 AC 9 ms
28,636 KB
testcase_17 AC 9 ms
28,636 KB
testcase_18 AC 8 ms
28,636 KB
testcase_19 AC 9 ms
28,636 KB
testcase_20 AC 12 ms
28,636 KB
testcase_21 AC 8 ms
28,636 KB
testcase_22 AC 9 ms
28,636 KB
testcase_23 AC 8 ms
28,636 KB
testcase_24 AC 15 ms
28,636 KB
testcase_25 AC 19 ms
28,636 KB
testcase_26 AC 30 ms
28,636 KB
testcase_27 AC 18 ms
28,636 KB
testcase_28 AC 31 ms
28,636 KB
testcase_29 AC 10 ms
28,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <atcoder/modint>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;
using namespace atcoder;
using mint = modint998244353;

int n, m, K;
mint dp[200001][1 << 5];
int bitCnt[1 << 5];

signed main() {
	int i, j, k;

	cin >> n >> m >> K;

	rep(i, 32) {
		rep(j, 5) bitCnt[i] += (i >> j) % 2;
		if (i < (1LL << n)) dp[1][i] = 1;
	}

	for (i = 1; i < m; i++) {
		rep(j, (1LL << n)) {
			if (dp[i][j] == 0) continue;
			rep(k, (1LL << n)) {
				if (bitCnt[j & k] < K) continue;
				dp[i + 1][k] += dp[i][j];
			}
		}
	}

	mint ans = 0;
	rep(i, (1LL << n)) ans += dp[m][i];

	cout << ans.val() << endl;
	return 0;
}
0