結果

問題 No.2711 Connecting Lights
ユーザー hiro1729hiro1729
提出日時 2024-03-31 13:53:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,725 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,080 KB
最終ジャッジ日時 2024-03-31 13:54:38
合計ジャッジ時間 32,765 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 49 ms
66,456 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 88 ms
75,708 KB
testcase_06 AC 64 ms
75,688 KB
testcase_07 AC 62 ms
75,708 KB
testcase_08 AC 98 ms
75,704 KB
testcase_09 AC 2,219 ms
75,824 KB
testcase_10 AC 1,698 ms
75,672 KB
testcase_11 AC 2,978 ms
75,816 KB
testcase_12 AC 749 ms
75,688 KB
testcase_13 AC 876 ms
75,688 KB
testcase_14 AC 129 ms
75,704 KB
testcase_15 AC 485 ms
75,688 KB
testcase_16 AC 90 ms
75,708 KB
testcase_17 AC 98 ms
75,708 KB
testcase_18 AC 167 ms
75,704 KB
testcase_19 AC 2,383 ms
75,800 KB
testcase_20 AC 962 ms
75,688 KB
testcase_21 AC 93 ms
75,708 KB
testcase_22 AC 65 ms
75,708 KB
testcase_23 AC 69 ms
75,708 KB
testcase_24 AC 1,393 ms
75,824 KB
testcase_25 AC 1,677 ms
75,824 KB
testcase_26 AC 3,725 ms
76,080 KB
testcase_27 AC 3,610 ms
75,944 KB
testcase_28 AC 3,687 ms
76,080 KB
testcase_29 AC 3,533 ms
75,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, K = map(int, input().split())
mod = 998244353
dp = [1] * (1 << n)
for i in range(m - 1):
	ndp = [0] * (1 << n)
	for j in range(1 << n):
		for k in range(1 << n):
			# dp[j]→ndp[k]
			if bin(j & k).count('1') >= K:
				ndp[k] += dp[j]
				ndp[k] %= mod
	dp = ndp
print(sum(dp) % mod)
0