結果
| 問題 | No.2742 Car Flow |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2024-04-20 11:14:36 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 623 bytes |
| 記録 | |
| コンパイル時間 | 2,898 ms |
| コンパイル使用メモリ | 246,488 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 06:53:59 |
| 合計ジャッジ時間 | 5,176 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 WA * 25 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>; //B(n,V<int>(n))
const int MOD=998244353;
ll modpow(ll x,ll n){
x%=MOD;
ll ans=1;
while(n){
if(n&1) ans=ans*x%MOD;
x=x*x%MOD;
n/=2;
}
return ans;
}
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
cin>>n;
V<int> A(n);
int cnt=0;
rep(i,n){
cin>>A[i];
if(A[i]==1) cnt++;
}
cout<<cnt*modpow(n,MOD-2)%MOD<<endl;
return 0;
}
umezo