結果

問題 No.1620 Substring Sum
ユーザー だれだれ
提出日時 2021-07-14 00:00:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 98,480 KB
最終ジャッジ日時 2024-07-17 15:55:30
合計ジャッジ時間 2,618 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
88,920 KB
testcase_01 AC 65 ms
88,980 KB
testcase_02 AC 65 ms
88,580 KB
testcase_03 AC 64 ms
89,492 KB
testcase_04 AC 72 ms
97,160 KB
testcase_05 AC 78 ms
97,324 KB
testcase_06 AC 73 ms
98,480 KB
testcase_07 AC 73 ms
98,184 KB
testcase_08 AC 73 ms
97,740 KB
testcase_09 AC 71 ms
96,540 KB
testcase_10 AC 72 ms
97,676 KB
testcase_11 AC 72 ms
97,296 KB
testcase_12 AC 68 ms
92,396 KB
testcase_13 AC 72 ms
96,400 KB
testcase_14 AC 72 ms
96,876 KB
testcase_15 AC 72 ms
97,396 KB
testcase_16 AC 70 ms
94,264 KB
testcase_17 AC 72 ms
96,324 KB
testcase_18 AC 63 ms
89,392 KB
testcase_19 AC 64 ms
88,780 KB
testcase_20 AC 72 ms
97,708 KB
testcase_21 AC 72 ms
97,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

exp2 = [1]
exp11 = [1]
for _ in range(200000):
    exp2.append(exp2[-1] * 2 % mod)
    exp11.append(exp11[-1] * 11 % mod)

s = input()
n = len(s)

ans = 0
for i in range(n):
    ans += exp2[i] * exp11[n - i - 1] * int(s[i])
    ans %= mod

print(ans)
0