結果

問題 No.2711 Connecting Lights
ユーザー 👑 tipstar0125tipstar0125
提出日時 2024-03-31 16:12:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,655 ms / 5,000 ms
コード長 504 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,356 KB
最終ジャッジ日時 2024-03-31 16:13:11
合計ジャッジ時間 24,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 56 ms
70,488 KB
testcase_03 AC 39 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 93 ms
76,980 KB
testcase_06 AC 73 ms
75,628 KB
testcase_07 AC 70 ms
75,784 KB
testcase_08 AC 99 ms
76,048 KB
testcase_09 AC 1,619 ms
79,644 KB
testcase_10 AC 1,205 ms
78,644 KB
testcase_11 AC 2,091 ms
81,172 KB
testcase_12 AC 575 ms
78,996 KB
testcase_13 AC 636 ms
79,528 KB
testcase_14 AC 120 ms
76,404 KB
testcase_15 AC 369 ms
77,636 KB
testcase_16 AC 97 ms
76,980 KB
testcase_17 AC 104 ms
77,332 KB
testcase_18 AC 144 ms
77,020 KB
testcase_19 AC 1,679 ms
80,148 KB
testcase_20 AC 702 ms
79,792 KB
testcase_21 AC 99 ms
77,100 KB
testcase_22 AC 76 ms
75,908 KB
testcase_23 AC 79 ms
77,348 KB
testcase_24 AC 1,024 ms
78,052 KB
testcase_25 AC 1,249 ms
78,644 KB
testcase_26 AC 2,649 ms
82,356 KB
testcase_27 AC 2,535 ms
82,356 KB
testcase_28 AC 2,655 ms
82,356 KB
testcase_29 AC 2,491 ms
82,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

MOD=998244353
dp=[[0 for _ in range(1<<N)] for _ in range(M)]
for i in range(1<<N):dp[0][i]=1

def popcount(x):
    ret=0
    for i in range(5):
        if x>>i&1==1:ret+=1
    return ret

for i in range(1,M):
    for j in range(1<<N):
        for k in range(1<<N):
            x=j&k
            if popcount(x)>=K:
                dp[i][j]+=dp[i-1][k]
                dp[i][j]%=MOD

ans=0            
for i in range(1<<N):
    ans+=dp[M-1][i]
    ans%=MOD
print(ans)
0