結果

問題 No.2711 Connecting Lights
ユーザー flippergo
提出日時 2025-07-14 12:11:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,636 KB
実行使用メモリ 83,316 KB
最終ジャッジ日時 2025-07-14 12:12:08
合計ジャッジ時間 19,687 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
N,M,K = map(int,input().split())
if M==1:
    ans = 0
else:
    dp = [[0 for _ in range((1<<N))] for _ in range(M+1)]
    for s in range(1<<N):
        for t in range(1<<N):
            if bin(s&t).count("1")<K:continue
            dp[2][s] += 1
    for m in range(3,M+1):
        for s in range(1<<N):
            cnt = bin(s).count("1")
            if cnt<K:continue
            for t in range(1<<N):
                if bin(s&t).count("1")<K:continue
                dp[m][s] = (dp[m][s]+dp[m-1][t])%MOD
    ans = 0
    for s in range(1<<N):
        cnt = bin(s).count("1")
        if cnt<K:continue
        ans = (ans+dp[M][s])%MOD
print(ans)
0