結果
| 問題 |
No.2711 Connecting Lights
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-31 14:02:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 200 ms / 5,000 ms |
| コード長 | 1,047 bytes |
| コンパイル時間 | 1,953 ms |
| コンパイル使用メモリ | 199,916 KB |
| 最終ジャッジ日時 | 2025-02-20 16:50:58 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/modint>
using mint = atcoder::modint998244353;
using namespace std;
using ll = long long;
using ld = long double;
template <class T = ll>
using vc = vector<T>;
template <class T = ll>
using vvc = vc<vc<T>>;
void solve();
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
ll t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) solve();
return 0;
}
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
ll dy[4] = {0, 1, 0, -1}, dx[4] = {1, 0, -1, 0};
void solve() {
ll n, m, k;
cin >> n >> m >> k;
vvc<mint> dp(m + 1, vc<mint>(1 << n));
rep(i, 0, 1 << n) dp[1][i] = 1;
rep(i, 1, m) {
rep(j, 0, 1 << n) {
rep(l, 0, 1 << n) {
ll cnt = 0;
rep(x, 0, n) if ((j >> x & 1) && (l >> x & 1)) cnt++;
if (cnt >= k) dp[i + 1][l] += dp[i][j];
}
}
}
mint res = 0;
rep(i, 0, 1 << n) res += dp[m][i];
cout << res.val() << endl;
}