結果

問題 No.2711 Connecting Lights
ユーザー loop0919loop0919
提出日時 2024-03-31 14:51:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,742 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,388 KB
最終ジャッジ日時 2024-03-31 14:52:24
合計ジャッジ時間 31,973 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 47 ms
66,588 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 34 ms
53,460 KB
testcase_05 AC 90 ms
76,992 KB
testcase_06 AC 62 ms
75,696 KB
testcase_07 AC 61 ms
75,968 KB
testcase_08 AC 103 ms
76,220 KB
testcase_09 AC 2,212 ms
79,668 KB
testcase_10 AC 1,641 ms
78,760 KB
testcase_11 AC 2,926 ms
81,308 KB
testcase_12 AC 746 ms
78,904 KB
testcase_13 AC 875 ms
79,564 KB
testcase_14 AC 126 ms
76,588 KB
testcase_15 AC 487 ms
77,624 KB
testcase_16 AC 92 ms
77,120 KB
testcase_17 AC 100 ms
77,376 KB
testcase_18 AC 164 ms
77,116 KB
testcase_19 AC 2,317 ms
80,168 KB
testcase_20 AC 943 ms
79,828 KB
testcase_21 AC 96 ms
77,248 KB
testcase_22 AC 66 ms
76,096 KB
testcase_23 AC 70 ms
77,528 KB
testcase_24 AC 1,410 ms
78,140 KB
testcase_25 AC 1,707 ms
78,652 KB
testcase_26 AC 3,719 ms
82,388 KB
testcase_27 AC 3,539 ms
82,364 KB
testcase_28 AC 3,742 ms
82,388 KB
testcase_29 AC 3,485 ms
82,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

N, M, K = map(int, input().split())

if M == 1:
    print(2**N)
    exit()

dp = [[0]*(1<<N) for _ in range(M)]
dp[0] = [1 if bin(i)[2:].count('1') >= K else 0 for i in range(1<<N)]

for i in range(1, M):
    for pre_bit in range(1<<N):
        for next_bit in range(1<<N):
            if bin(pre_bit & next_bit)[2:].count('1') >= K:
                dp[i][next_bit] += dp[i-1][pre_bit]
                dp[i][next_bit] %= MOD

print(sum(dp[-1]) % MOD)
0