結果
問題 |
No.1964 sum = length
|
ユーザー |
![]() |
提出日時 | 2022-06-04 20:17:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 598 bytes |
コンパイル時間 | 1,787 ms |
コンパイル使用メモリ | 193,080 KB |
最終ジャッジ日時 | 2025-01-29 18:11:05 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include<bits/stdc++.h> using namespace std; const int MOD=998244353; ll dp[202][202]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; dp[0][0]=1; for(int i=0;i<n;i++){ for(int j=0;j<=n-1;j++){ for(int k=0;k<=n-1;k++){ if(j+k>n-1) continue; if(k!=8 && k!=97) dp[i+1][j+k]=(dp[i+1][j+k]+dp[i][j])%MOD; else dp[i+1][j+k]=(dp[i+1][j+k]+2*dp[i][j]%MOD)%MOD; } } } cout<<dp[n][n-1]<<endl; return 0; }