結果

問題 No.1510 Simple Integral
ユーザー gew1fw
提出日時 2025-06-12 20:46:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 61,144 KB
最終ジャッジ日時 2025-06-12 20:47:34
合計ジャッジ時間 3,456 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

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

result = 0

for k in range(n):
    ak = a[k]
    denominator_part = 1
    for j in range(n):
        if j == k:
            continue
        aj = a[j]
        term = (aj * aj) % MOD
        term = (term - (ak * ak) % MOD) % MOD
        denominator_part = (denominator_part * term) % MOD
    denominator = (ak % MOD) * denominator_part % MOD
    inv_denominator = pow(denominator, MOD - 2, MOD)
    result = (result + inv_denominator) % MOD

print(result)
0