結果
| 問題 |
No.2685 Cell Proliferation (Easy)
|
| コンテスト | |
| ユーザー |
nonon
|
| 提出日時 | 2024-03-20 22:03:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 521 bytes |
| コンパイル時間 | 1,859 ms |
| コンパイル使用メモリ | 196,084 KB |
| 最終ジャッジ日時 | 2025-02-20 09:11:22 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
int P1,P2,Q1,Q2,T;
mint dp[1010][1010];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>P1>>P2>>Q1>>Q2>>T;
mint P=mint(P1)/P2;
mint Q=mint(Q1)/Q2;
dp[0][0]=1;
for(int i=1;i<=T;i++)for(int j=0;j<i;j++)
{
dp[i][i]+=P*dp[i-1][j];
dp[i][j]=dp[i-1][j]*Q.pow(i-j);
}
mint ans=0;
for(int j=0;j<=T;j++)ans+=dp[T][j];
cout<<ans.val()<<endl;
}
nonon