結果

問題 No.1620 Substring Sum
ユーザー minimumminimum
提出日時 2021-07-22 21:59:49
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 1,368 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 83,144 KB
最終ジャッジ日時 2023-09-24 16:53:20
合計ジャッジ時間 5,802 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,104 KB
testcase_01 AC 75 ms
71,448 KB
testcase_02 AC 74 ms
71,328 KB
testcase_03 AC 73 ms
71,540 KB
testcase_04 AC 175 ms
82,976 KB
testcase_05 AC 174 ms
83,036 KB
testcase_06 AC 174 ms
83,024 KB
testcase_07 AC 171 ms
82,680 KB
testcase_08 AC 172 ms
82,900 KB
testcase_09 AC 168 ms
82,832 KB
testcase_10 AC 171 ms
83,104 KB
testcase_11 AC 171 ms
82,912 KB
testcase_12 AC 109 ms
78,656 KB
testcase_13 AC 164 ms
82,188 KB
testcase_14 AC 173 ms
82,540 KB
testcase_15 AC 155 ms
81,940 KB
testcase_16 AC 133 ms
79,980 KB
testcase_17 AC 155 ms
81,540 KB
testcase_18 AC 73 ms
71,212 KB
testcase_19 AC 75 ms
71,248 KB
testcase_20 AC 171 ms
83,144 KB
testcase_21 AC 172 ms
82,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

s = list(input())
n = len(s)
s = [int(i) for i in s]

dp = [0] * (n + 1)

for i in range(n):
    dp[i + 1] = (11 * dp[i] + pow(2, i, mod) * s[i]) % mod

print(dp[-1])
0