結果

問題 No.1620 Substring Sum
ユーザー ああいいああいい
提出日時 2021-12-28 18:30:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,088 KB
最終ジャッジ日時 2024-04-10 10:28:41
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 28 ms
10,624 KB
testcase_03 AC 31 ms
10,624 KB
testcase_04 AC 212 ms
20,088 KB
testcase_05 AC 206 ms
20,080 KB
testcase_06 AC 209 ms
20,084 KB
testcase_07 AC 208 ms
19,808 KB
testcase_08 AC 206 ms
19,944 KB
testcase_09 AC 198 ms
19,552 KB
testcase_10 AC 209 ms
19,828 KB
testcase_11 AC 199 ms
19,784 KB
testcase_12 AC 86 ms
13,772 KB
testcase_13 AC 190 ms
19,080 KB
testcase_14 AC 191 ms
19,244 KB
testcase_15 AC 172 ms
18,432 KB
testcase_16 AC 132 ms
16,024 KB
testcase_17 AC 172 ms
18,008 KB
testcase_18 AC 29 ms
10,624 KB
testcase_19 AC 28 ms
10,624 KB
testcase_20 AC 213 ms
20,084 KB
testcase_21 AC 202 ms
19,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(map(int,list(input())))
P = 998244353

dp = [0] * len(S)
dp[0] = S[0]
now = 1
for i in range(1,len(S)):
    now = now * 2 % P
    dp[i] = 11 * dp[i-1] + now * S[i]
    dp[i] %= P
print(dp[-1])
0