結果

問題 No.2711 Connecting Lights
ユーザー sepa38sepa38
提出日時 2024-02-06 21:00:31
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 412 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,276 KB
最終ジャッジ日時 2024-02-06 21:00:51
合計ジャッジ時間 17,683 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 47 ms
64,432 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 78 ms
76,872 KB
testcase_06 AC 52 ms
66,500 KB
testcase_07 AC 48 ms
64,436 KB
testcase_08 AC 71 ms
76,132 KB
testcase_09 AC 2,072 ms
79,424 KB
testcase_10 AC 51 ms
70,576 KB
testcase_11 AC 202 ms
81,088 KB
testcase_12 AC 408 ms
78,784 KB
testcase_13 AC 162 ms
79,468 KB
testcase_14 AC 48 ms
66,488 KB
testcase_15 AC 428 ms
77,504 KB
testcase_16 AC 80 ms
77,000 KB
testcase_17 AC 84 ms
77,256 KB
testcase_18 AC 90 ms
77,028 KB
testcase_19 AC 52 ms
72,624 KB
testcase_20 AC 499 ms
79,708 KB
testcase_21 AC 80 ms
77,128 KB
testcase_22 AC 47 ms
64,436 KB
testcase_23 AC 52 ms
72,776 KB
testcase_24 AC 1,084 ms
78,168 KB
testcase_25 AC 1,643 ms
78,528 KB
testcase_26 AC 3,516 ms
82,256 KB
testcase_27 AC 1,140 ms
82,276 KB
testcase_28 AC 3,530 ms
82,256 KB
testcase_29 AC 67 ms
82,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
assert m > 1
mod = 998244353
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)
0