結果

問題 No.2754 Cumulate and Drop
ユーザー 👑 p-adicp-adic
提出日時 2024-05-06 19:33:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 152,448 KB
最終ジャッジ日時 2024-05-06 19:34:00
合計ジャッジ時間 4,616 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,840 KB
testcase_01 AC 36 ms
51,584 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 37 ms
51,968 KB
testcase_04 AC 37 ms
52,480 KB
testcase_05 AC 41 ms
52,096 KB
testcase_06 AC 37 ms
51,968 KB
testcase_07 AC 36 ms
52,096 KB
testcase_08 AC 93 ms
94,848 KB
testcase_09 AC 146 ms
131,340 KB
testcase_10 AC 197 ms
137,740 KB
testcase_11 AC 134 ms
124,516 KB
testcase_12 AC 200 ms
152,116 KB
testcase_13 AC 183 ms
131,044 KB
testcase_14 AC 200 ms
130,984 KB
testcase_15 AC 143 ms
124,332 KB
testcase_16 AC 81 ms
88,960 KB
testcase_17 AC 239 ms
152,448 KB
testcase_18 AC 203 ms
152,188 KB
testcase_19 AC 213 ms
152,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
N=int(I())
A=list(map(int,I().split()))
P=998244353
Q=[1,1]
F=Q[:]
G=Q[:]
for i in R(2,2*N):
	Q+=[P-P//i*Q[P%i]%P]
	F+=[F[-1]*i%P]
	G+=[G[-1]*Q[i]%P]
print(sum(A[i]*F[2*N-2-i]*G[N-1-i]*(i+1)for i in R(N))*G[N-1]*Q[N]%P)
0