結果

問題 No.2711 Connecting Lights
ユーザー 👑 Nafmo2Nafmo2
提出日時 2024-01-22 19:58:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,553 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,480 KB
最終ジャッジ日時 2024-01-23 00:20:39
合計ジャッジ時間 31,098 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 46 ms
66,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 34 ms
53,460 KB
testcase_05 AC 92 ms
77,096 KB
testcase_06 AC 67 ms
75,700 KB
testcase_07 AC 65 ms
76,000 KB
testcase_08 AC 101 ms
76,240 KB
testcase_09 AC 2,109 ms
79,760 KB
testcase_10 AC 1,577 ms
78,900 KB
testcase_11 AC 2,825 ms
81,168 KB
testcase_12 AC 728 ms
79,120 KB
testcase_13 AC 841 ms
79,524 KB
testcase_14 AC 127 ms
76,620 KB
testcase_15 AC 481 ms
77,748 KB
testcase_16 AC 97 ms
77,084 KB
testcase_17 AC 108 ms
77,584 KB
testcase_18 AC 164 ms
77,132 KB
testcase_19 AC 2,242 ms
80,144 KB
testcase_20 AC 909 ms
79,660 KB
testcase_21 AC 100 ms
77,200 KB
testcase_22 AC 69 ms
76,128 KB
testcase_23 AC 75 ms
77,600 KB
testcase_24 AC 1,338 ms
78,276 KB
testcase_25 AC 1,640 ms
78,772 KB
testcase_26 AC 3,513 ms
82,480 KB
testcase_27 AC 3,343 ms
82,352 KB
testcase_28 AC 3,553 ms
82,480 KB
testcase_29 AC 3,384 ms
82,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
N, M, K = map(int, input().split())
dp = [[0 for i in range(1 << N)] for j in range(M)]
ans = 0
for i in range(1 << N):
    dp[0][i] = 1
for i in range(M - 1):
    for bit in range(1 << N):
        for next in range(1 << N):
            if bin(bit & next).count("1") >= K:
                dp[i + 1][next] += dp[i][bit]
                dp[i + 1][next] %= MOD
print(sum(dp[M - 1]) % MOD)
0