結果

問題 No.2561 みんな大好きmod 998
ユーザー 👑 deuteridayodeuteridayo
提出日時 2023-11-05 15:02:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,853 ms / 4,000 ms
コード長 301 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 10,128 KB
最終ジャッジ日時 2023-11-05 15:02:55
合計ジャッジ時間 23,385 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,128 KB
testcase_01 AC 125 ms
10,128 KB
testcase_02 AC 30 ms
10,128 KB
testcase_03 AC 1,758 ms
10,128 KB
testcase_04 AC 1,595 ms
10,128 KB
testcase_05 AC 1,853 ms
10,128 KB
testcase_06 AC 1,601 ms
10,128 KB
testcase_07 AC 30 ms
10,128 KB
testcase_08 AC 29 ms
10,128 KB
testcase_09 AC 33 ms
10,128 KB
testcase_10 AC 30 ms
10,128 KB
testcase_11 AC 305 ms
10,128 KB
testcase_12 AC 30 ms
10,128 KB
testcase_13 AC 30 ms
10,128 KB
testcase_14 AC 30 ms
10,128 KB
testcase_15 AC 1,820 ms
10,128 KB
testcase_16 AC 30 ms
10,128 KB
testcase_17 AC 29 ms
10,128 KB
testcase_18 AC 31 ms
10,128 KB
testcase_19 AC 1,351 ms
10,128 KB
testcase_20 AC 30 ms
10,128 KB
testcase_21 AC 29 ms
10,128 KB
testcase_22 AC 29 ms
10,128 KB
testcase_23 AC 29 ms
10,128 KB
testcase_24 AC 30 ms
10,128 KB
testcase_25 AC 30 ms
10,128 KB
testcase_26 AC 391 ms
10,128 KB
testcase_27 AC 1,570 ms
10,128 KB
testcase_28 AC 445 ms
10,128 KB
testcase_29 AC 157 ms
10,128 KB
testcase_30 AC 444 ms
10,128 KB
testcase_31 AC 862 ms
10,128 KB
testcase_32 AC 180 ms
10,128 KB
testcase_33 AC 155 ms
10,128 KB
testcase_34 AC 1,570 ms
10,128 KB
testcase_35 AC 127 ms
10,128 KB
testcase_36 AC 127 ms
10,128 KB
testcase_37 AC 86 ms
10,128 KB
testcase_38 AC 304 ms
10,128 KB
testcase_39 AC 509 ms
10,128 KB
testcase_40 AC 508 ms
10,128 KB
testcase_41 AC 305 ms
10,128 KB
testcase_42 AC 510 ms
10,128 KB
testcase_43 AC 84 ms
10,128 KB
testcase_44 AC 233 ms
10,128 KB
testcase_45 AC 1,363 ms
10,128 KB
testcase_46 AC 179 ms
10,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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