結果

問題 No.2561 みんな大好きmod 998
ユーザー 👑 deuteridayodeuteridayo
提出日時 2023-11-05 14:59:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,241 ms / 4,000 ms
コード長 300 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 11,908 KB
実行使用メモリ 10,124 KB
最終ジャッジ日時 2023-11-05 15:00:27
合計ジャッジ時間 28,115 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,124 KB
testcase_01 AC 139 ms
10,124 KB
testcase_02 AC 29 ms
10,124 KB
testcase_03 AC 2,192 ms
10,124 KB
testcase_04 AC 1,974 ms
10,124 KB
testcase_05 AC 2,241 ms
10,124 KB
testcase_06 AC 1,980 ms
10,124 KB
testcase_07 AC 30 ms
10,124 KB
testcase_08 AC 29 ms
10,124 KB
testcase_09 AC 34 ms
10,124 KB
testcase_10 AC 30 ms
10,124 KB
testcase_11 AC 350 ms
10,124 KB
testcase_12 AC 29 ms
10,124 KB
testcase_13 AC 29 ms
10,124 KB
testcase_14 AC 32 ms
10,124 KB
testcase_15 AC 2,206 ms
10,124 KB
testcase_16 AC 29 ms
10,124 KB
testcase_17 AC 30 ms
10,124 KB
testcase_18 AC 30 ms
10,124 KB
testcase_19 AC 1,601 ms
10,124 KB
testcase_20 AC 31 ms
10,124 KB
testcase_21 AC 31 ms
10,124 KB
testcase_22 AC 30 ms
10,124 KB
testcase_23 AC 30 ms
10,124 KB
testcase_24 AC 31 ms
10,124 KB
testcase_25 AC 31 ms
10,124 KB
testcase_26 AC 459 ms
10,124 KB
testcase_27 AC 1,939 ms
10,124 KB
testcase_28 AC 564 ms
10,124 KB
testcase_29 AC 189 ms
10,124 KB
testcase_30 AC 528 ms
10,124 KB
testcase_31 AC 1,045 ms
10,124 KB
testcase_32 AC 223 ms
10,124 KB
testcase_33 AC 181 ms
10,124 KB
testcase_34 AC 1,973 ms
10,124 KB
testcase_35 AC 151 ms
10,124 KB
testcase_36 AC 151 ms
10,124 KB
testcase_37 AC 95 ms
10,124 KB
testcase_38 AC 358 ms
10,124 KB
testcase_39 AC 620 ms
10,124 KB
testcase_40 AC 626 ms
10,124 KB
testcase_41 AC 355 ms
10,124 KB
testcase_42 AC 610 ms
10,124 KB
testcase_43 AC 95 ms
10,124 KB
testcase_44 AC 269 ms
10,124 KB
testcase_45 AC 1,654 ms
10,124 KB
testcase_46 AC 208 ms
10,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
M1 = 998244353
M2 = 998
ans = 0

def f(B, idx):
	global ans
	if(len(B) == K):
		S = sum(B)
		if (S%M1) <= (S%M2):
			ans = (ans + 1) % M2
		return
	for i in range(idx, N):
		B.append(A[i])
		f(B, i+1)
		B.pop()

f([], 0)
print(ans)
0