結果

問題 No.2742 Car Flow
ユーザー Shibaken_8128Shibaken_8128
提出日時 2024-04-20 14:03:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,630 bytes
コンパイル時間 1,519 ms
コンパイル使用メモリ 114,052 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 14:03:08
合計ジャッジ時間 3,752 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
5,248 KB
testcase_01 AC 13 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 14 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 10 ms
5,376 KB
testcase_13 AC 8 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 14 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 6 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 11 ms
5,376 KB
testcase_23 AC 13 ms
5,376 KB
testcase_24 AC 8 ms
5,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 6 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 2 ms
5,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 13 ms
5,376 KB
testcase_33 AC 12 ms
5,376 KB
testcase_34 AC 7 ms
5,376 KB
testcase_35 AC 5 ms
5,376 KB
testcase_36 WA -
testcase_37 AC 6 ms
5,376 KB
testcase_38 AC 12 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 2 ms
5,376 KB
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>
#include <climits>
#include <cmath>
#include <functional>
#include <numeric>
#include <regex>
#include <array>
#include <fstream>
#include <sstream>

//#include<atcoder/modint>
//using namespace atcoder;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define repl(i,l,r) for (int i = l; i < (int)(r); i++)
#define all(a) a.begin(),a.end()
#define Pii pair<int,int>
#define Pll pair<long,long>
#define INFi 1000000001
#define INFl 1000000000000000001
#define ll long long
using namespace std;



template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T> void printArray(vector<T>&A){
    for(T&a:A){
        cout<<a<<" ";
    }
    cout<<endl;
}
template<class T> void printArrayln(vector<T>&A){
    for(T&a:A){
        cout<<a<<endl;
    }
}


template<class T1,class T2> std::ostream &operator<<(std::ostream &out, const pair<T1,T2> &A){
    cout<<"{"<<A.first<<","<<A.second<<"}";
    return out;
}

template<class T1,class T2> std::ostream &operator<<(std::ostream &out, const map<T1,T2> &M){
    for(const auto&A:M){
        cout<<"{"<<A.first<<","<<A.second<<"}";
    }
    return out;
}

template<class T1> std::ostream &operator<<(std::ostream &out, const set<T1> &M){
    cout<<"{";
    for(const auto&A:M){
        cout<<A<<", ";
    }
    cout<<"}"<<endl;
    return out;
}


template<class T1> std::ostream &operator<<(std::ostream &out, const multiset<T1> &M){
    cout<<"{";
    for(const auto&A:M){
        cout<<A<<", ";
    }
    cout<<"}"<<endl;
    return out;
}

template<class T> std::ostream &operator<<(std::ostream &out, const vector<T> &A){
    for(const T &a:A){
        cout<<a<<" ";
    }
    return out;
}

void print() { cout << endl; }
 
template <typename Head, typename... Tail>
void print(Head H, Tail... T) {
  cout << H << " ";
  print(T...);
}


template<class T> std::istream &operator>>(std::istream &in,vector<T>&A){
    for(T&a:A){
        std::cin>>a;
    }
    return in;
}

struct Edge{
    int to;
    long cost;
    long time;
};

using Graph = vector<vector<Edge>>;

struct State{
    int v;
    long cost;
    long time;
    bool operator>(const State &s) const{
        if(time==s.time){
            return cost<s.cost;
        }
        return time>s.time;
    }
};

constexpr long mod = 998244353;

long modpow(long a,long n){
    long res=1;
    while(n>0){
        if(n&1){
            res=res*a%mod;
        }
        a=a*a%mod;
        n>>=1;
    }
    return res;
}

long modinv(long a){
    return modpow(a,mod-2);
}

int main(void){
    std::cin.tie(0)->sync_with_stdio(0);
    int N;cin>>N;
    int cnt = 0;
    rep(i,N){int a;cin>>a;cnt+=a;}
    long ans = cnt;
    ans *= modinv(N);
    ans %= mod;
    cout<<ans<<endl;
}

0