結果

問題 No.1620 Substring Sum
ユーザー lloyzlloyz
提出日時 2023-11-15 00:54:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 85,280 KB
最終ジャッジ日時 2023-11-15 00:54:14
合計ジャッジ時間 5,908 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 36 ms
53,332 KB
testcase_03 AC 36 ms
53,332 KB
testcase_04 AC 225 ms
85,276 KB
testcase_05 AC 224 ms
85,276 KB
testcase_06 AC 223 ms
85,276 KB
testcase_07 AC 228 ms
85,236 KB
testcase_08 AC 228 ms
85,260 KB
testcase_09 AC 217 ms
85,080 KB
testcase_10 AC 219 ms
85,220 KB
testcase_11 AC 217 ms
85,144 KB
testcase_12 AC 95 ms
68,568 KB
testcase_13 AC 211 ms
83,380 KB
testcase_14 AC 209 ms
83,480 KB
testcase_15 AC 188 ms
79,540 KB
testcase_16 AC 145 ms
76,000 KB
testcase_17 AC 183 ms
79,432 KB
testcase_18 AC 37 ms
53,332 KB
testcase_19 AC 36 ms
53,332 KB
testcase_20 AC 224 ms
85,280 KB
testcase_21 AC 249 ms
85,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = list(map(int, list(input())))
mod = 998244353

n = len(L)
ans = 0
for i in range(n):
    x = L[n - i - 1]
    # pow(11, i, mod)は数字xより右側
    # pow(2, n - i - 1, mod)は数字xより左側
    ans += x * pow(11, i, mod) % mod * pow(2, n - i - 1, mod) % mod
    ans %= mod
print(ans)
0