結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-02 14:51:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 599 ms / 4,000 ms |
| コード長 | 743 bytes |
| 記録 | |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 85,888 KB |
| 実行使用メモリ | 86,400 KB |
| 最終ジャッジ日時 | 2026-04-13 19:01:34 |
| 合計ジャッジ時間 | 11,504 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
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)