結果

問題 No.1620 Substring Sum
ユーザー だれだれ
提出日時 2021-07-14 00:00:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 104,480 KB
最終ジャッジ日時 2023-09-24 15:09:39
合計ジャッジ時間 3,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
103,312 KB
testcase_01 AC 99 ms
103,244 KB
testcase_02 AC 97 ms
103,440 KB
testcase_03 AC 98 ms
103,364 KB
testcase_04 AC 104 ms
104,224 KB
testcase_05 AC 105 ms
104,332 KB
testcase_06 AC 104 ms
104,448 KB
testcase_07 AC 104 ms
104,308 KB
testcase_08 AC 105 ms
104,464 KB
testcase_09 AC 105 ms
104,384 KB
testcase_10 AC 105 ms
104,220 KB
testcase_11 AC 107 ms
104,480 KB
testcase_12 AC 103 ms
104,012 KB
testcase_13 AC 107 ms
104,340 KB
testcase_14 AC 105 ms
104,384 KB
testcase_15 AC 103 ms
104,288 KB
testcase_16 AC 103 ms
104,108 KB
testcase_17 AC 104 ms
104,292 KB
testcase_18 AC 97 ms
103,544 KB
testcase_19 AC 97 ms
103,464 KB
testcase_20 AC 104 ms
104,332 KB
testcase_21 AC 108 ms
104,368 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