結果
問題 |
No.2943 Sigma String of String Score Problem
|
ユーザー |
![]() |
提出日時 | 2024-10-18 23:32:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,020 ms / 3,000 ms |
コード長 | 256 bytes |
コンパイル時間 | 435 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 76,312 KB |
最終ジャッジ日時 | 2024-10-18 23:36:01 |
合計ジャッジ時間 | 12,042 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
s, t = input().split() mod = 998244353 dp = [0]*(len(t) + 1) dp[0] = 1 for i in range(len(s)): for j in range(len(t), 0, -1): if s[i] == t[j-1]: dp[j] += dp[j-1] dp[j] %= mod print(dp[-1]*pow(2, len(s)-len(t), mod)%mod)