結果

問題 No.1510 Simple Integral
ユーザー 정현우정현우
提出日時 2022-01-15 01:28:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 868 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 227,876 KB
最終ジャッジ日時 2024-04-30 20:28:25
合計ジャッジ時間 4,281 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
17,696 KB
testcase_01 AC 34 ms
10,752 KB
testcase_02 AC 34 ms
10,880 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 TLE -
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
        denom%=mod
    

    return numer*pow(denom,-1,mod)%mod


def change(tuple_1,A2):
    N1,A1,m1=tuple_1
    if A1==A2:
        return [(N1,A1,m1+1)]
    if m1==1:
        return [(N1*(A2**2-A1**2)%mod,A1,1),(-N1*(A2**2-A1**2)%mod,A2,1)]
    else:
        tmp=change((-N1*(A2**2-A1**2)%mod, A1, m1-1), A2)
        return [(N1*(A2**2-A1**2)%mod,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