結果

問題 No.2742 Car Flow
ユーザー kenken714kenken714
提出日時 2024-04-13 18:09:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 787 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 195,320 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 09:30:34
合計ジャッジ時間 3,833 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1ll << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>

ll mod = 998244353;
ll powmod(ll a, ll b, ll mod = 1e9+7) {
	a %= mod;
	ll res = 1;
	while (b > 0) {
		if (b % 2 == 1)res = res * a % mod;
		a = a * a % mod;
		b /= 2;
	}
	return res;
}

int main(){
    ll n, cnt = 0;
    cin >> n;
    REP(i, n){
        ll a;
        cin >> a;
        if(a)cnt++;
    }
    cout << cnt * powmod(n, mod - 2, mod) % mod << endl;
}
0