結果

問題 No.2742 Car Flow
ユーザー Series_205Series_205
提出日時 2024-04-20 17:02:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,497 bytes
コンパイル時間 2,255 ms
コンパイル使用メモリ 195,076 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 17:02:44
合計ジャッジ時間 4,827 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
5,248 KB
testcase_01 AC 33 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 32 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 21 ms
5,376 KB
testcase_13 AC 17 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 33 ms
5,376 KB
testcase_18 AC 4 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 11 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 26 ms
5,376 KB
testcase_23 AC 30 ms
5,376 KB
testcase_24 AC 17 ms
5,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 12 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 2 ms
5,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 29 ms
5,376 KB
testcase_33 AC 26 ms
5,376 KB
testcase_34 AC 14 ms
5,376 KB
testcase_35 AC 9 ms
5,376 KB
testcase_36 WA -
testcase_37 AC 11 ms
5,376 KB
testcase_38 AC 27 ms
5,376 KB
testcase_39 WA -
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 2 ms
5,376 KB
testcase_46 WA -
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 AC 3 ms
5,376 KB
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define FOR(i, l, r) for(ll i = l; i < r; i++)
#define rep(i, n) FOR(i, 0, n)
#define FORR(i, l, r) for(ll i = r - 1; i >= l; i--)
#define ALL(ar) begin(ar), end(ar)

template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
    is >> p.first >> p.second;
    return is;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    os << p.first << ' ' << p.second;
    return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for(T &x : v) is >> x;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for(size_t i = 0; i < v.size(); i++) os << (i ? " " : "") << v[i];
    return os;
}
//-------------------------------------------------

ll mod = 998244353;

ll modpow(ll x, ll n = mod - 2) {
    ll res = 1;
    while(n) {
        if(n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    cin >> a;
    int sum = 0;
    for(int x : a) sum += x;
    cout << modpow(n) * sum % mod << endl;
}

int main() {
    int t = 1;
    // cin >> t;
    while(t--) solve();
}
0