結果

問題 No.1510 Simple Integral
ユーザー 정현우정현우
提出日時 2022-01-15 01:16:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 804 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 302,748 KB
最終ジャッジ日時 2024-04-30 20:13:19
合計ジャッジ時間 3,928 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,820 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 26 ms
10,880 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 RE -
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#(1/pi)*(1/N)*Integral[1/(x^2+A^2)^m,{x,-Infinity,Infinity}]
#=>cal(N,A,m)

mod=998244353

def cal(N,A,m):
    numer=1
    denom=N*pow(A,2*m-1,mod)*pow(4,m-1,mod)%mod
    for i in range(m,2*m-1):
        numer*=i
        numer%=mod
    for i in range(1,m):
        denom*=i*i
        denom%=mod
    return numer*pow(denom,-1,mod)%mod



def change(tuple_1,A2):
    N1,A1,m1=tuple_1
    if m1==1:
        return [(N1*(A2**2-A1**2),A1,1),(-N1*(A2**2-A1**2),A2,1)]
    else:
        tmp=change((-N1*(A2**2-A1**2), A1, m1-1), A2)
        return [(N1*(A2**2-A1**2),A1,m1)]+tmp

n=int(input())
a=list(map(int,input().split()))
a.sort()

li=[(1,a[0],1)]
for i in range(1,n):
    ret=[]
    for tu in li:
        ret+=change(tu,a[i])
    li=ret[:]
#print(li)
ans=0
for tu in li:
    ans+=cal(*tu)
print(ans%mod)
0