結果

問題 No.2711 Connecting Lights
ユーザー sepa38sepa38
提出日時 2024-02-06 20:43:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 82,280 KB
最終ジャッジ日時 2024-02-06 20:43:27
合計ジャッジ時間 15,538 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,460 KB
testcase_01 AC 32 ms
53,460 KB
testcase_02 AC 42 ms
64,436 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 69 ms
76,876 KB
testcase_06 AC 47 ms
66,504 KB
testcase_07 AC 43 ms
64,440 KB
testcase_08 AC 64 ms
76,136 KB
testcase_09 AC 1,751 ms
79,428 KB
testcase_10 AC 44 ms
70,580 KB
testcase_11 AC 162 ms
81,092 KB
testcase_12 AC 371 ms
78,788 KB
testcase_13 AC 144 ms
79,472 KB
testcase_14 AC 42 ms
66,492 KB
testcase_15 AC 382 ms
77,508 KB
testcase_16 AC 71 ms
77,004 KB
testcase_17 AC 73 ms
77,260 KB
testcase_18 AC 78 ms
77,032 KB
testcase_19 AC 47 ms
72,628 KB
testcase_20 AC 433 ms
79,712 KB
testcase_21 AC 67 ms
77,132 KB
testcase_22 AC 51 ms
64,440 KB
testcase_23 AC 44 ms
72,780 KB
testcase_24 AC 940 ms
78,172 KB
testcase_25 AC 1,380 ms
78,532 KB
testcase_26 AC 2,976 ms
82,260 KB
testcase_27 AC 985 ms
82,280 KB
testcase_28 AC 2,992 ms
82,260 KB
testcase_29 AC 58 ms
82,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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