結果

問題 No.1620 Substring Sum
ユーザー rlangevinrlangevin
提出日時 2023-07-04 08:56:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 1,287 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 93,720 KB
最終ジャッジ日時 2023-09-25 06:32:58
合計ジャッジ時間 5,143 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 70 ms
71,504 KB
testcase_02 AC 71 ms
71,376 KB
testcase_03 AC 70 ms
71,332 KB
testcase_04 AC 98 ms
93,592 KB
testcase_05 AC 96 ms
93,656 KB
testcase_06 AC 96 ms
93,720 KB
testcase_07 AC 97 ms
93,636 KB
testcase_08 AC 97 ms
93,464 KB
testcase_09 AC 97 ms
93,424 KB
testcase_10 AC 96 ms
93,620 KB
testcase_11 AC 95 ms
93,488 KB
testcase_12 AC 83 ms
80,956 KB
testcase_13 AC 95 ms
91,676 KB
testcase_14 AC 93 ms
91,764 KB
testcase_15 AC 93 ms
89,720 KB
testcase_16 AC 92 ms
86,256 KB
testcase_17 AC 93 ms
89,760 KB
testcase_18 AC 73 ms
71,388 KB
testcase_19 AC 72 ms
71,228 KB
testcase_20 AC 98 ms
93,508 KB
testcase_21 AC 96 ms
93,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
S = list(map(int, S))
S.reverse()
mod = 998244353
N = len(S)
two = pow(2, N - 1, mod)
inv = pow(2, mod - 2, mod)
eleven = 1
ans = 0
for s in S:
    ans += two * s * eleven
    ans %= mod
    two *= inv
    eleven *= 11
    two %= mod
    eleven %= mod

print(ans)
0