結果
| 問題 |
No.1510 Simple Integral
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:41:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 500 bytes |
| コンパイル時間 | 484 ms |
| コンパイル使用メモリ | 82,372 KB |
| 実行使用メモリ | 61,196 KB |
| 最終ジャッジ日時 | 2025-06-12 15:41:36 |
| 合計ジャッジ時間 | 3,610 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 31 |
ソースコード
MOD = 998244353
n = int(input())
a = list(map(int, input().split()))
a_squared = [(x * x) % MOD for x in a]
sum_result = 0
for i in range(n):
product = 1
ai_sq = a_squared[i]
ai = a[i]
for k in range(n):
if k != i:
term = (a_squared[k] - ai_sq) % MOD
product = (product * term) % MOD
denominator = (ai * product) % MOD
inv_denominator = pow(denominator, MOD - 2, MOD)
sum_result = (sum_result + inv_denominator) % MOD
print(sum_result)
gew1fw