結果

問題 No.2711 Connecting Lights
ユーザー loop0919loop0919
提出日時 2024-03-31 14:47:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,388 KB
最終ジャッジ日時 2024-03-31 14:47:59
合計ジャッジ時間 33,044 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 51 ms
66,588 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 90 ms
76,992 KB
testcase_06 AC 63 ms
75,696 KB
testcase_07 AC 62 ms
75,968 KB
testcase_08 AC 100 ms
76,220 KB
testcase_09 AC 2,305 ms
79,668 KB
testcase_10 AC 1,759 ms
78,760 KB
testcase_11 AC 3,176 ms
81,308 KB
testcase_12 AC 794 ms
78,904 KB
testcase_13 AC 949 ms
79,564 KB
testcase_14 AC 127 ms
76,592 KB
testcase_15 AC 489 ms
77,624 KB
testcase_16 AC 93 ms
77,120 KB
testcase_17 AC 102 ms
77,376 KB
testcase_18 AC 174 ms
77,116 KB
testcase_19 AC 2,334 ms
80,168 KB
testcase_20 AC 953 ms
79,828 KB
testcase_21 AC 99 ms
77,248 KB
testcase_22 AC 73 ms
76,096 KB
testcase_23 AC 71 ms
77,528 KB
testcase_24 AC 1,393 ms
78,140 KB
testcase_25 AC 1,737 ms
78,652 KB
testcase_26 AC 3,761 ms
82,388 KB
testcase_27 AC 3,634 ms
82,364 KB
testcase_28 AC 3,814 ms
82,388 KB
testcase_29 AC 3,583 ms
82,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

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

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