結果

問題 No.2561 みんな大好きmod 998
ユーザー vwxyzvwxyz
提出日時 2024-02-13 10:41:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 523 ms / 4,000 ms
コード長 1,000 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 90,080 KB
最終ジャッジ日時 2024-02-13 10:41:45
合計ジャッジ時間 13,146 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
88,928 KB
testcase_01 AC 167 ms
89,952 KB
testcase_02 AC 137 ms
88,928 KB
testcase_03 AC 521 ms
89,952 KB
testcase_04 AC 488 ms
89,824 KB
testcase_05 AC 523 ms
89,824 KB
testcase_06 AC 512 ms
89,952 KB
testcase_07 AC 144 ms
88,928 KB
testcase_08 AC 140 ms
88,928 KB
testcase_09 AC 151 ms
89,824 KB
testcase_10 AC 141 ms
88,928 KB
testcase_11 AC 204 ms
89,952 KB
testcase_12 AC 140 ms
88,928 KB
testcase_13 AC 146 ms
88,928 KB
testcase_14 AC 141 ms
88,928 KB
testcase_15 AC 494 ms
90,080 KB
testcase_16 AC 156 ms
88,928 KB
testcase_17 AC 138 ms
88,928 KB
testcase_18 AC 144 ms
89,056 KB
testcase_19 AC 405 ms
89,952 KB
testcase_20 AC 142 ms
89,824 KB
testcase_21 AC 166 ms
88,928 KB
testcase_22 AC 138 ms
88,928 KB
testcase_23 AC 141 ms
89,056 KB
testcase_24 AC 138 ms
88,928 KB
testcase_25 AC 139 ms
88,928 KB
testcase_26 AC 216 ms
89,952 KB
testcase_27 AC 515 ms
89,952 KB
testcase_28 AC 242 ms
89,952 KB
testcase_29 AC 173 ms
89,952 KB
testcase_30 AC 227 ms
89,952 KB
testcase_31 AC 321 ms
89,952 KB
testcase_32 AC 204 ms
89,952 KB
testcase_33 AC 177 ms
89,952 KB
testcase_34 AC 502 ms
89,952 KB
testcase_35 AC 179 ms
89,952 KB
testcase_36 AC 172 ms
89,952 KB
testcase_37 AC 166 ms
89,952 KB
testcase_38 AC 199 ms
89,952 KB
testcase_39 AC 231 ms
89,952 KB
testcase_40 AC 233 ms
89,952 KB
testcase_41 AC 201 ms
89,952 KB
testcase_42 AC 247 ms
89,952 KB
testcase_43 AC 162 ms
89,952 KB
testcase_44 AC 184 ms
89,952 KB
testcase_45 AC 392 ms
89,952 KB
testcase_46 AC 181 ms
89,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
import time
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines
write=sys.stdout.write
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
#sys.set_int_max_str_digits(10**9)

N,K=map(int,input().split())
A=list(map(int,input().split()))
mod0=998
mod1=998244353
ans=0
for tpl in itertools.combinations(A,K):
    S=sum(tpl)
    if S%mod1<=S%mod0:
        ans+=1
        ans%=mod0
print(ans)
0