結果

問題 No.2561 みんな大好きmod 998
ユーザー machoniumpmachoniump
提出日時 2023-12-02 15:17:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,145 ms / 4,000 ms
コード長 339 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2023-12-02 15:17:47
合計ジャッジ時間 35,961 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,984 KB
testcase_01 AC 136 ms
9,984 KB
testcase_02 AC 27 ms
9,984 KB
testcase_03 AC 2,613 ms
9,984 KB
testcase_04 AC 2,711 ms
9,984 KB
testcase_05 AC 3,145 ms
9,984 KB
testcase_06 AC 2,675 ms
9,984 KB
testcase_07 AC 26 ms
9,984 KB
testcase_08 AC 26 ms
9,984 KB
testcase_09 AC 30 ms
9,984 KB
testcase_10 AC 25 ms
9,984 KB
testcase_11 AC 466 ms
9,984 KB
testcase_12 AC 26 ms
9,984 KB
testcase_13 AC 26 ms
9,984 KB
testcase_14 AC 26 ms
9,984 KB
testcase_15 AC 3,000 ms
9,984 KB
testcase_16 AC 26 ms
9,984 KB
testcase_17 AC 24 ms
9,984 KB
testcase_18 AC 27 ms
9,984 KB
testcase_19 AC 2,187 ms
9,984 KB
testcase_20 AC 28 ms
9,984 KB
testcase_21 AC 27 ms
9,984 KB
testcase_22 AC 26 ms
9,984 KB
testcase_23 AC 26 ms
9,984 KB
testcase_24 AC 26 ms
9,984 KB
testcase_25 AC 27 ms
9,984 KB
testcase_26 AC 636 ms
9,984 KB
testcase_27 AC 2,656 ms
9,984 KB
testcase_28 AC 735 ms
9,984 KB
testcase_29 AC 224 ms
9,984 KB
testcase_30 AC 643 ms
9,984 KB
testcase_31 AC 1,326 ms
9,984 KB
testcase_32 AC 332 ms
9,984 KB
testcase_33 AC 225 ms
9,984 KB
testcase_34 AC 2,644 ms
9,984 KB
testcase_35 AC 192 ms
9,984 KB
testcase_36 AC 197 ms
9,984 KB
testcase_37 AC 123 ms
9,984 KB
testcase_38 AC 471 ms
9,984 KB
testcase_39 AC 760 ms
9,984 KB
testcase_40 AC 758 ms
9,984 KB
testcase_41 AC 505 ms
9,984 KB
testcase_42 AC 830 ms
9,984 KB
testcase_43 AC 112 ms
9,984 KB
testcase_44 AC 358 ms
9,984 KB
testcase_45 AC 2,169 ms
9,984 KB
testcase_46 AC 316 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
MOD=998244353
mod=998

def solve(l):
    s=0
    for i in l:
        s+=a[i]
    if s%MOD <= s%mod:
        return True
    return False    
for i in combinations(range(n),k):
    l=list(i)
    if solve(l):
        ans+=1
print(ans%mod)
0