結果

問題 No.1510 Simple Integral
ユーザー maine_honzuki
提出日時 2021-05-14 23:08:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 642 bytes
コンパイル時間 4,245 ms
コンパイル使用メモリ 256,628 KB
最終ジャッジ日時 2025-01-21 12:07:50
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#include "atcoder/all"
using namespace atcoder;
using Mint = modint998244353;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> mp;
    Mint maine = 1;
    for (auto&& a : A) {
        cin >> a;
        mp[a]++;
        maine *= a;
    }
    Mint ans = 0;
    for (auto&& [a, n] : mp) {
        Mint book = 1;
        for (auto&& b : A) {
            if (b != a)
                book /= (-Mint{a} * Mint{a} + Mint{b} * Mint{b});
            else
                book /= Mint{2} * a;
        }
        ans += book;
    }
    ans *= 2;
    cout << ans.val() << endl;
}
0