結果

問題 No.1510 Simple Integral
ユーザー 👑 Nachia
提出日時 2021-05-14 23:02:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 663 bytes
コンパイル時間 899 ms
コンパイル使用メモリ 77,844 KB
最終ジャッジ日時 2025-01-21 12:02:05
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 10 WA * 2 RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/modint>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using mll = atcoder::static_modint<998244353>;
#define rep(i,n) for(int i=0; i<(n); i++)

int N;
vector<mll> A;

int main(){
  cin >> N;
  vector<mll> A(N); rep(i,N){ int a; cin >> a; A[i] = a; }
  mll ans = 0;
  rep(i,N){
    mll tmp = A[i];
    rep(j,N) if(i!=j) tmp *= (A[i]*A[i]-A[j]*A[j]);
    ans += tmp.inv();
  }
  cout << (-ans).val() << "\n";
  return 0;
}


struct ios_do_not_sync{
  ios_do_not_sync(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} ios_do_not_sync_instance;

0