結果

問題 No.2561 みんな大好きmod 998
ユーザー KemtyKemty
提出日時 2023-12-02 14:51:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 570 ms / 4,000 ms
コード長 743 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 80,728 KB
最終ジャッジ日時 2023-12-02 14:51:13
合計ジャッジ時間 10,560 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
80,088 KB
testcase_01 AC 105 ms
80,600 KB
testcase_02 AC 83 ms
80,088 KB
testcase_03 AC 543 ms
80,728 KB
testcase_04 AC 541 ms
80,728 KB
testcase_05 AC 565 ms
80,724 KB
testcase_06 AC 555 ms
80,728 KB
testcase_07 AC 85 ms
80,088 KB
testcase_08 AC 83 ms
80,084 KB
testcase_09 AC 89 ms
80,600 KB
testcase_10 AC 83 ms
80,088 KB
testcase_11 AC 155 ms
80,728 KB
testcase_12 AC 83 ms
80,084 KB
testcase_13 AC 84 ms
80,084 KB
testcase_14 AC 83 ms
80,088 KB
testcase_15 AC 411 ms
80,728 KB
testcase_16 AC 85 ms
80,084 KB
testcase_17 AC 83 ms
80,088 KB
testcase_18 AC 86 ms
80,600 KB
testcase_19 AC 387 ms
80,724 KB
testcase_20 AC 87 ms
80,600 KB
testcase_21 AC 84 ms
80,084 KB
testcase_22 AC 88 ms
80,084 KB
testcase_23 AC 86 ms
80,600 KB
testcase_24 AC 83 ms
80,088 KB
testcase_25 AC 82 ms
80,088 KB
testcase_26 AC 146 ms
80,728 KB
testcase_27 AC 570 ms
80,724 KB
testcase_28 AC 166 ms
80,728 KB
testcase_29 AC 108 ms
80,724 KB
testcase_30 AC 202 ms
80,728 KB
testcase_31 AC 329 ms
80,728 KB
testcase_32 AC 127 ms
80,724 KB
testcase_33 AC 117 ms
80,728 KB
testcase_34 AC 568 ms
80,728 KB
testcase_35 AC 108 ms
80,728 KB
testcase_36 AC 106 ms
80,728 KB
testcase_37 AC 97 ms
80,596 KB
testcase_38 AC 131 ms
80,728 KB
testcase_39 AC 200 ms
80,724 KB
testcase_40 AC 199 ms
80,728 KB
testcase_41 AC 131 ms
80,728 KB
testcase_42 AC 170 ms
80,728 KB
testcase_43 AC 95 ms
80,600 KB
testcase_44 AC 118 ms
80,724 KB
testcase_45 AC 441 ms
80,728 KB
testcase_46 AC 111 ms
80,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint
import sys
# sys.setrecursionlimit(200000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)

#################################################    

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for C in combinations(A, K):
    s, t = 0, 0
    for c in C:
        s = (s+c)%998
        t = (t+c)%998244353
    ans += (t <= s)
    ans %= 998
print(ans)
0