結果
| 問題 |
No.2711 Connecting Lights
|
| コンテスト | |
| ユーザー |
blue_jam
|
| 提出日時 | 2024-03-31 14:56:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 775 bytes |
| コンパイル時間 | 4,773 ms |
| コンパイル使用メモリ | 253,804 KB |
| 最終ジャッジ日時 | 2025-02-20 17:31:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 2 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
int main() {
/* F */
ll H, W, K;
cin >> H >> W >> K;
vector<vector<mint>> dp(W + 1, vector<mint>(1 << H, 0));
dp[0][(1 << H) - 1] = 1LL;
for (ll j = 0; j < W; j++) {
for (ll s = 0; s < (1 << H); s++) {
for (ll t = 0; t < (1 << H); t++) {
ll u = s & t;
ll cnt = __builtin_popcount(u);
if (cnt >= K) {
dp[j + 1][t] += dp[j][s];
}
}
}
}
mint ans = 0;
for (ll s = 0; s < (1 << H); s++) {
ans += dp[W][s];
}
cout << ans.val() << endl;
return 0;
}
blue_jam