問題一覧 > 通常問題

No.1510 Simple Integral

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 21
作問者 : 👑 qand / テスター : oliverx3 magsta yuto1115
お気に入りにしたユーザー ProblemId : 6095 / 自分の提出
問題文最終更新日: 2023-07-11 20:17:36
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 295 (順位表) の他の問題:

Problem Statement

You are given a sequence $A=(A_1 , \ldots , A_N)$ consisting of $N$ positive integers.

Find $\displaystyle \frac1\pi\int_{-\infty}^\infty\prod_{i=1}^N\frac1{x^2+A_i^2}dx$.

It can be proved that this value is a rational number, so print it modulo $\text{mod}\ 998244353$ as described in the Notes.

Notes

To print a rational number, first express it as a fraction $\displaystyle\frac pq$, where $p,q$ are integers and $q$ is not divisible by $998244353$ (under the constraints of this problem, such a representation is always possible). Then print the unique integer $k$ between $0$ and less than $998244353$ such that $qk\equiv p \left(\text{mod}\ 998244353\right)$.

Constraints

  • $1\le N \le 100$
  • $1\le A_i \le 10^6$
  • All input values are integers.
  • Input

    $N$
    $A_1\ \ldots\ A_N$
    

    Output

    Print the answer in $\text{mod}\ 998244353$.

    Sample

    Sample 1
    Input
    1
    1
    Output
    1

    We have $\displaystyle\frac1\pi\int_{-\infty}^\infty\frac1{x^2+1}dx=1$.

    Sample 2
    Input
    2
    2 1
    Output
    166374059

    We have $\displaystyle\frac1\pi\int_{-\infty}^\infty\frac1{(x^2+2^2)(x^2+1^2)}dx=\frac16$. The only positive integer $k$ less than $998244353$ satisfying $1\equiv 6k\ \text{mod}\ 998244353$ is $166374059$, so print $166374059$.

    Sample 3
    Input
    5
    3 14 159 265 358
    Output
    229199064

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。