結果

問題 No.1510 Simple Integral
ユーザー pockynypockyny
提出日時 2021-05-14 22:59:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 760 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 72,152 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 02:17:35
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 9 ms
6,944 KB
testcase_24 AC 9 ms
6,944 KB
testcase_25 AC 9 ms
6,944 KB
testcase_26 AC 9 ms
6,940 KB
testcase_27 AC 9 ms
6,944 KB
testcase_28 AC 9 ms
6,940 KB
testcase_29 AC 9 ms
6,940 KB
testcase_30 AC 9 ms
6,944 KB
testcase_31 AC 9 ms
6,940 KB
testcase_32 AC 9 ms
6,940 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
typedef long long ll;
ll mod = 998244353;
ll pw(ll a,ll x){
    ll ret = 1;
    while(x){
        if(x&1) (ret *= a) %= mod;
        (a *= a) %= mod; x /= 2;
    }
    return ret;
}

ll a[110];
int main(){
    int i,j,n; cin >> n;
    for(i=0;i<n;i++) cin >> a[i];
    ll ans = 0;
    for(i=0;i<n;i++){
        bool f = true;
        for(j=0;j<n;j++){
            if(j!=i && a[i]==a[j]) f = false;
        }
        if(!f) continue;
        ll val = pw(a[i],mod - 2);
        for(j=0;j<n;j++){
            if(j==i) continue;
            ll y = a[j]*a[j]%mod - a[i]*a[i]%mod + mod;
            y %= mod;
            (val *= pw(y,mod - 2)) %= mod; 
        }
        (ans += val) %= mod;
    }
    cout << ans << endl;
}
0