結果
| 問題 |
No.2792 Security Cameras on Young Diagram
|
| コンテスト | |
| ユーザー |
はるお味
|
| 提出日時 | 2024-06-29 02:33:28 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 746 bytes |
| コンパイル時間 | 2,951 ms |
| コンパイル使用メモリ | 246,048 KB |
| 実行使用メモリ | 13,888 KB |
| 最終ジャッジ日時 | 2024-06-29 02:33:36 |
| 合計ジャッジ時間 | 7,243 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 -- * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<VL> VVL;
typedef long long LL;
#define all(a) (a).begin(), (a).end()
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define ALL(a) (a).begin(),(a).end()
#include <atcoder/modint>
using mint = atcoder::modint998244353;
int main() {
int n; cin>>n;
int A[n];
rep(i,n){cin>>A[i];}
mint ans=A[0]+1;
mint fac[200001],gf[200001];
fac[0]=1; gf[0]=1;
for(int i=1;i<=200000;i++){
fac[i]=fac[i-1]*i;
gf[i]=1/fac[i];
}
for(int i=1;i<n;i++){
rep(j,A[i]){
ans+=fac[i+j]*(gf[i]*gf[j]);
}
}
cout<<ans.val()<<endl;
}
はるお味