結果

問題 No.2754 Cumulate and Drop
ユーザー 👑 p-adicp-adic
提出日時 2024-05-06 19:34:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,009 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 69,996 KB
最終ジャッジ日時 2024-05-09 22:34:53
合計ジャッジ時間 11,557 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,624 KB
testcase_01 AC 32 ms
10,624 KB
testcase_02 AC 33 ms
10,752 KB
testcase_03 AC 35 ms
10,880 KB
testcase_04 AC 33 ms
10,752 KB
testcase_05 AC 34 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 211 ms
23,240 KB
testcase_09 AC 642 ms
50,388 KB
testcase_10 AC 849 ms
62,056 KB
testcase_11 AC 587 ms
47,008 KB
testcase_12 AC 949 ms
69,420 KB
testcase_13 AC 935 ms
65,500 KB
testcase_14 AC 992 ms
68,296 KB
testcase_15 AC 557 ms
43,160 KB
testcase_16 AC 174 ms
20,380 KB
testcase_17 AC 987 ms
69,836 KB
testcase_18 AC 1,009 ms
69,864 KB
testcase_19 AC 976 ms
69,996 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