結果

問題 No.1620 Substring Sum
ユーザー shotoyooshotoyoo
提出日時 2021-07-22 22:25:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 90,516 KB
最終ジャッジ日時 2023-09-24 17:35:44
合計ジャッジ時間 6,548 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,340 KB
testcase_01 AC 70 ms
71,424 KB
testcase_02 AC 69 ms
71,160 KB
testcase_03 AC 70 ms
71,156 KB
testcase_04 AC 251 ms
90,516 KB
testcase_05 AC 251 ms
90,428 KB
testcase_06 AC 250 ms
90,504 KB
testcase_07 AC 249 ms
90,420 KB
testcase_08 AC 253 ms
90,312 KB
testcase_09 AC 246 ms
90,300 KB
testcase_10 AC 247 ms
90,392 KB
testcase_11 AC 247 ms
90,248 KB
testcase_12 AC 128 ms
79,776 KB
testcase_13 AC 235 ms
88,580 KB
testcase_14 AC 243 ms
88,928 KB
testcase_15 AC 220 ms
87,296 KB
testcase_16 AC 175 ms
84,572 KB
testcase_17 AC 213 ms
87,284 KB
testcase_18 AC 71 ms
71,300 KB
testcase_19 AC 70 ms
71,192 KB
testcase_20 AC 255 ms
90,268 KB
testcase_21 AC 249 ms
90,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


a = list(map(int, input()))
n = len(a)
M = 998244353
ans = 0
for i in range(n):
    v = a[n-1-i]
    ans += v * pow(2, n-1-i, M) * pow(11, i, M) % M 
    ans %= M
print(ans%M)
0