結果

問題 No.1620 Substring Sum
ユーザー wolgnikwolgnik
提出日時 2021-07-22 21:45:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 1,350 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 95,032 KB
最終ジャッジ日時 2023-09-24 16:19:26
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,920 KB
testcase_01 AC 72 ms
71,304 KB
testcase_02 AC 74 ms
71,300 KB
testcase_03 AC 73 ms
71,016 KB
testcase_04 AC 183 ms
94,780 KB
testcase_05 AC 179 ms
94,816 KB
testcase_06 AC 180 ms
95,032 KB
testcase_07 AC 178 ms
94,724 KB
testcase_08 AC 179 ms
94,924 KB
testcase_09 AC 175 ms
94,592 KB
testcase_10 AC 177 ms
94,820 KB
testcase_11 AC 176 ms
94,596 KB
testcase_12 AC 107 ms
81,256 KB
testcase_13 AC 169 ms
92,968 KB
testcase_14 AC 169 ms
92,804 KB
testcase_15 AC 158 ms
90,884 KB
testcase_16 AC 137 ms
87,368 KB
testcase_17 AC 157 ms
90,908 KB
testcase_18 AC 71 ms
70,980 KB
testcase_19 AC 71 ms
71,448 KB
testcase_20 AC 178 ms
94,896 KB
testcase_21 AC 178 ms
94,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
S = list(map(int, list(input())[: -1]))
mod = 998244353

dp = 0
for i in range(len(S)):
  x = S[i]
  dp += (dp * 10 + x * pow(2, i, mod)) % mod
  dp %= mod
print(dp)
0