結果
問題 | No.2711 Connecting Lights |
ユーザー |
![]() |
提出日時 | 2024-02-06 21:03:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 3,138 ms / 5,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 82,688 KB |
最終ジャッジ日時 | 2024-09-28 12:13:31 |
合計ジャッジ時間 | 15,170 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
n, m, k = map(int, input().split()) mod = 998244353 if m == 1: print(pow(2, n, mod)) exit() dp = [[0] * 2 ** n for _ in range(m)] dp[0] = [1] * 2 ** n ls = [] for i in range(2**n): if bin(i).count("1") >= k: ls.append(i) for i in range(1, m): for j in ls: for l in ls: if bin(j & l).count("1") < k: continue dp[i][j] += dp[i-1][l] dp[i][j] %= mod ans = 0 for i in ls: ans += dp[-1][i] print(ans % mod)