No.1620 Substring Sum
問題文最終更新日: 2026-04-28 14:21:07
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
問題文一行コンテスト
(順位表)
の他の問題:
Problem Statement
For every non-empty, not necessarily contiguous substring of a string $S$ consisting only of 1 ~ 9, consider its value when regarded as an integer in decimal notation, and find the sum of these values.
Input
$S$
- $1\leq |S|\leq 2\times 10^5$
- $S$ consists only of
1~9
Output
Print the answer on one line.
Since the answer can be very large, print the remainder when divided by $998244353$.
Sample
Sample 1
Input
123
Output
177
$1+2+3+12+13+23+123=177$.
Sample 2
Input
3141592653589793238462643383279
Output
103881841
Answer with the remainder when divided by $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
だれ
nok0