結果

問題 No.2711 Connecting Lights
ユーザー miya145592miya145592
提出日時 2024-03-31 15:32:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 673 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 177,056 KB
最終ジャッジ日時 2024-03-31 15:32:31
合計ジャッジ時間 7,433 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 44 ms
59,440 KB
testcase_02 AC 53 ms
66,384 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 86 ms
78,352 KB
testcase_06 AC 55 ms
68,432 KB
testcase_07 AC 56 ms
68,432 KB
testcase_08 AC 85 ms
77,928 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
MOD = 998244353
N, M, K = map(int, input().split())
dp = [[0 for _ in range(1<<(N*2))] for _ in range(M)]
for i in range(1<<N):
    dp[0][i] = 1
for i in range(M-1):
    for j in range(1<<(N*2)):
        if dp[i][j]==0:
            continue
        for k in range(1<<N):
            nj = (j&((1<<N)-1))<<N
            nj |= k
            cnt = 0
            for l in range(N):
                if (nj&(1<<l))!=0 and (nj&(1<<(l+N)))!=0:
                    cnt+=1
            if cnt>=K:
                dp[i+1][nj] += dp[i][j]
                dp[i+1][nj] %= MOD
#print(dp)
ans = 0
for d in dp[M-1]:
    ans += d
    ans %= MOD
print(ans)
0