結果

問題 No.2556 Increasing Matrix
ユーザー 👑 NachiaNachia
提出日時 2023-12-20 17:24:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 762 bytes
コンパイル時間 722 ms
コンパイル使用メモリ 79,544 KB
実行使用メモリ 10,132 KB
最終ジャッジ日時 2023-12-20 17:24:15
合計ジャッジ時間 9,721 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 4 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 3 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 9 ms
6,676 KB
testcase_14 AC 36 ms
6,676 KB
testcase_15 AC 29 ms
6,676 KB
testcase_16 AC 20 ms
6,676 KB
testcase_17 AC 47 ms
6,676 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
const i64 INF = 1001001001001001001;
const char* yn(bool x){ return x ? "Yes" : "No"; }
using Modint = atcoder::static_modint<998244353>;


void testcase(){
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    Modint f = 1, ff = 1;
    for(int i=1; i<N; i++){ ff *= (f *= i); }
    Modint q = 1;
    rep(i,N) A[i] += i;
    rep(i,N) rep(j,i) q *= A[i] - A[j];
    q /= ff;
    q *= q;
    cout << q.val() << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    testcase();
    return 0;
}
0