結果

問題 No.2561 みんな大好きmod 998
ユーザー YuuuTYuuuT
提出日時 2023-12-02 14:48:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 576 ms / 4,000 ms
コード長 750 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,720 KB
最終ジャッジ日時 2023-12-02 14:48:18
合計ジャッジ時間 8,589 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
55,760 KB
testcase_01 AC 67 ms
75,592 KB
testcase_02 AC 45 ms
55,760 KB
testcase_03 AC 529 ms
75,720 KB
testcase_04 AC 531 ms
75,592 KB
testcase_05 AC 535 ms
75,592 KB
testcase_06 AC 576 ms
75,592 KB
testcase_07 AC 38 ms
55,760 KB
testcase_08 AC 37 ms
55,760 KB
testcase_09 AC 47 ms
64,200 KB
testcase_10 AC 38 ms
55,760 KB
testcase_11 AC 94 ms
75,572 KB
testcase_12 AC 41 ms
55,760 KB
testcase_13 AC 41 ms
55,760 KB
testcase_14 AC 41 ms
55,760 KB
testcase_15 AC 387 ms
75,720 KB
testcase_16 AC 39 ms
55,760 KB
testcase_17 AC 41 ms
55,760 KB
testcase_18 AC 45 ms
61,932 KB
testcase_19 AC 326 ms
75,720 KB
testcase_20 AC 43 ms
61,928 KB
testcase_21 AC 37 ms
55,760 KB
testcase_22 AC 37 ms
55,760 KB
testcase_23 AC 41 ms
61,928 KB
testcase_24 AC 39 ms
55,760 KB
testcase_25 AC 44 ms
55,760 KB
testcase_26 AC 110 ms
75,572 KB
testcase_27 AC 544 ms
75,592 KB
testcase_28 AC 132 ms
75,572 KB
testcase_29 AC 75 ms
75,572 KB
testcase_30 AC 172 ms
75,592 KB
testcase_31 AC 292 ms
75,592 KB
testcase_32 AC 81 ms
75,572 KB
testcase_33 AC 70 ms
75,572 KB
testcase_34 AC 551 ms
75,592 KB
testcase_35 AC 72 ms
75,572 KB
testcase_36 AC 69 ms
75,572 KB
testcase_37 AC 55 ms
72,244 KB
testcase_38 AC 92 ms
75,572 KB
testcase_39 AC 166 ms
75,592 KB
testcase_40 AC 163 ms
75,592 KB
testcase_41 AC 103 ms
75,572 KB
testcase_42 AC 141 ms
75,572 KB
testcase_43 AC 56 ms
72,244 KB
testcase_44 AC 82 ms
75,572 KB
testcase_45 AC 404 ms
75,592 KB
testcase_46 AC 74 ms
75,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,math
#if len(sys.argv)==2:sys.stdin=open(sys.argv[1])
from collections import defaultdict,deque
from itertools import combinations,permutations,accumulate,product
from bisect import bisect,bisect_left,bisect_right
from heapq import heappop,heappush,heapify
#from sortedcontainers import SortedList,SortedSet
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def ms(): return map(int, input().split())
def li(): return list(map(int,input().split()))
#////////////////////////////////////
N,K = ms()
A = li()
ans = 0
num = [i for i in range(N)]
for com in combinations(num,K):
  s1 = 0
  s2 = 0
  for x in com:
    s1 += A[x]
    s1 %= 998
    s2 += A[x]
    s2 %= 998244353
  if s2<=s1: ans += 1
print(ans%998)
0