結果

問題 No.1620 Substring Sum
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-20 22:43:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 8,440 KB
最終ジャッジ日時 2023-09-15 22:24:48
合計ジャッジ時間 4,477 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,904 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 15 ms
7,832 KB
testcase_03 AC 15 ms
7,824 KB
testcase_04 AC 224 ms
8,328 KB
testcase_05 AC 223 ms
8,328 KB
testcase_06 AC 224 ms
8,440 KB
testcase_07 AC 219 ms
8,340 KB
testcase_08 AC 222 ms
8,236 KB
testcase_09 AC 219 ms
8,312 KB
testcase_10 AC 221 ms
8,388 KB
testcase_11 AC 216 ms
8,356 KB
testcase_12 AC 83 ms
8,324 KB
testcase_13 AC 209 ms
8,260 KB
testcase_14 AC 203 ms
8,196 KB
testcase_15 AC 187 ms
8,320 KB
testcase_16 AC 136 ms
8,192 KB
testcase_17 AC 179 ms
8,312 KB
testcase_18 AC 15 ms
7,852 KB
testcase_19 AC 15 ms
7,828 KB
testcase_20 AC 221 ms
8,284 KB
testcase_21 AC 221 ms
8,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
S = input()
N = len(S)

ans = 0
pow2 = 1
pow11 = pow(11, N - 1, mod)
for i, s in enumerate(S):
    ans += int(s) * pow2 % mod * pow11 % mod
    ans %= mod

    pow2 = pow2 * 2 % mod
    pow11 = pow11 * 272248460 % mod

print(ans)
0