結果

問題 No.2711 Connecting Lights
ユーザー ThetaTheta
提出日時 2024-04-10 16:41:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 887 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 153,856 KB
最終ジャッジ日時 2024-04-10 16:41:53
合計ジャッジ時間 43,598 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 AC 34 ms
52,608 KB
testcase_02 AC 54 ms
64,128 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 110 ms
82,028 KB
testcase_06 AC 78 ms
76,544 KB
testcase_07 AC 77 ms
77,824 KB
testcase_08 AC 122 ms
80,156 KB
testcase_09 AC 2,913 ms
121,600 KB
testcase_10 AC 2,286 ms
112,256 KB
testcase_11 AC 4,160 ms
140,956 KB
testcase_12 AC 1,087 ms
105,352 KB
testcase_13 AC 1,367 ms
111,488 KB
testcase_14 AC 147 ms
82,668 KB
testcase_15 AC 645 ms
94,080 KB
testcase_16 AC 133 ms
82,432 KB
testcase_17 AC 150 ms
83,456 KB
testcase_18 AC 196 ms
85,120 KB
testcase_19 AC 3,256 ms
127,936 KB
testcase_20 AC 1,327 ms
112,984 KB
testcase_21 AC 111 ms
82,816 KB
testcase_22 AC 78 ms
77,680 KB
testcase_23 AC 86 ms
80,676 KB
testcase_24 AC 1,812 ms
105,292 KB
testcase_25 AC 2,270 ms
111,232 KB
testcase_26 AC 4,894 ms
153,840 KB
testcase_27 AC 4,898 ms
153,820 KB
testcase_28 AC 4,788 ms
153,660 KB
testcase_29 AC 4,773 ms
153,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, M, K = map(int, input().split())
    MOD = 998244353
    dp_table = [[[0 for _ in range(N + 1)]
                 for _ in range(2**N)] for _ in range(M)]
    for column in range(M):
        for c_bit in range(2**N):
            if column == 0:
                dp_table[column][c_bit][c_bit.bit_count()] += 1
                continue

            for prev_bit in range(2**N):
                for prev_ctr in range(N + 1):
                    dp_table[column][c_bit][min(prev_ctr, (c_bit & prev_bit).bit_count(
                    ))] += (dp_table[column - 1][prev_bit][prev_ctr])
                    dp_table[column][c_bit][min(
                        prev_ctr, (c_bit & prev_bit).bit_count())] %= MOD
    ans = 0
    for elm in dp_table[-1]:
        for v in elm[K:]:
            ans += v
            ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()
0