結果
問題 |
No.2792 Security Cameras on Young Diagram
|
ユーザー |
![]() |
提出日時 | 2024-06-29 01:53:52 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 708 bytes |
コンパイル時間 | 3,179 ms |
コンパイル使用メモリ | 245,904 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-29 01:54:00 |
合計ジャッジ時間 | 6,905 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]; fac[0]=1; for(int i=1;i<=200000;i++){ fac[i]=fac[i-1]*i; } for(int i=1;i<n;i++){ rep(j,A[i]){ ans+=fac[i+j]/(fac[i]*fac[j]); } } cout<<ans.val()<<endl; }