結果
問題 | No.2963 Mecha DESU |
ユーザー |
![]() |
提出日時 | 2024-11-16 16:35:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,538 ms / 2,000 ms |
コード長 | 969 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 120,960 KB |
最終ジャッジ日時 | 2024-11-16 16:36:50 |
合計ジャッジ時間 | 43,587 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 57 |
ソースコード
from collections import defaultdict, deque, Counter# from functools import cache# import copyfrom itertools import combinations, permutations, product, accumulate, groupby, chain# from more_itertools import distinct_permutationsfrom heapq import heapify, heappop, heappush, heappushpopimport mathimport bisectfrom pprint import pprintfrom random import randint, shuffle, randrange# from sortedcontainers import SortedSet, SortedList, SortedDictimport sys# sys.setrecursionlimit(2000000)input = lambda: sys.stdin.readline().rstrip('\n')inf = float('inf')mod1 = 10**9+7mod2 = 998244353def ceil_div(x, y): return -(-x//y)#################################################N, M, K = map(int, input().split())A = Counter(map(int, input().split()))C = [0]*(1+N)for k, v in A.items():i = kwhile i <= N:C[i] += vi += kans = Nfor c in C[1:]:ans -= pow(M-c, K, mod2) * pow(M, -K, mod2) % mod2ans %= mod2print(ans)