結果

問題 No.2711 Connecting Lights
ユーザー prd_xxxprd_xxx
提出日時 2024-03-31 14:27:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 822 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,632 KB
最終ジャッジ日時 2024-03-31 14:27:09
合計ジャッジ時間 4,889 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 44 ms
61,964 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 55 ms
68,444 KB
testcase_06 AC 51 ms
64,444 KB
testcase_07 AC 53 ms
66,504 KB
testcase_08 AC 58 ms
68,592 KB
testcase_09 AC 233 ms
75,620 KB
testcase_10 AC 58 ms
70,624 KB
testcase_11 AC 88 ms
75,604 KB
testcase_12 AC 115 ms
75,632 KB
testcase_13 AC 71 ms
73,680 KB
testcase_14 AC 52 ms
66,508 KB
testcase_15 AC 99 ms
73,564 KB
testcase_16 AC 56 ms
68,444 KB
testcase_17 AC 57 ms
70,492 KB
testcase_18 AC 62 ms
70,640 KB
testcase_19 AC 60 ms
70,624 KB
testcase_20 AC 130 ms
75,632 KB
testcase_21 AC 57 ms
68,444 KB
testcase_22 AC 54 ms
66,504 KB
testcase_23 AC 54 ms
68,572 KB
testcase_24 AC 132 ms
75,620 KB
testcase_25 AC 193 ms
75,620 KB
testcase_26 AC 360 ms
75,620 KB
testcase_27 AC 159 ms
75,620 KB
testcase_28 AC 355 ms
75,620 KB
testcase_29 AC 65 ms
73,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def popcnt(n):
    c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c >> 4) & 0x0f0f0f0f0f0f0f0f)
    c = (c & 0x00ff00ff00ff00ff) + ((c >> 8) & 0x00ff00ff00ff00ff)
    c = (c & 0x0000ffff0000ffff) + ((c >> 16) & 0x0000ffff0000ffff)
    c = (c & 0x00000000ffffffff) + ((c >> 32) & 0x00000000ffffffff)
    return c

dp = [0] * (1<<N)
for s in range(1<<N):
    if popcnt(s) < K: continue
    dp[s] = 1

for _ in range(M-1):
    ndp = [0] * (1<<N)
    for s in range(1<<N):
        if popcnt(s) < K: continue
        for t in range(1<<N):
            if popcnt(s&t) < K: continue
            ndp[t] = (ndp[t] + dp[s]) % MOD
    dp = ndp
print(sum(dp) % MOD)
0