結果

問題 No.1620 Substring Sum
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-13 10:25:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 93,064 KB
最終ジャッジ日時 2023-09-07 15:24:00
合計ジャッジ時間 3,657 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
91,620 KB
testcase_01 AC 100 ms
91,552 KB
testcase_02 AC 97 ms
91,712 KB
testcase_03 AC 99 ms
91,788 KB
testcase_04 AC 106 ms
92,860 KB
testcase_05 AC 106 ms
92,896 KB
testcase_06 AC 108 ms
93,064 KB
testcase_07 AC 107 ms
92,548 KB
testcase_08 AC 107 ms
92,768 KB
testcase_09 AC 109 ms
92,792 KB
testcase_10 AC 105 ms
93,028 KB
testcase_11 AC 110 ms
92,488 KB
testcase_12 AC 101 ms
91,860 KB
testcase_13 AC 105 ms
92,364 KB
testcase_14 AC 106 ms
92,576 KB
testcase_15 AC 104 ms
92,324 KB
testcase_16 AC 105 ms
91,864 KB
testcase_17 AC 104 ms
92,312 KB
testcase_18 AC 99 ms
91,780 KB
testcase_19 AC 100 ms
91,704 KB
testcase_20 AC 106 ms
92,492 KB
testcase_21 AC 104 ms
92,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 10**6
mod = 998244353

table = [0]*N
table[0] = 1
for i in range(1, N):
    table[i] = table[i-1]*11
    table[i] %= mod

table2 = [0]*N
table2[0] = 1
for i in range(1, N):
    table2[i] = table2[i-1]*2
    table2[i] %= mod

s = str(input())
n = len(s)
ans = 0
for i, c in enumerate(s):
    ans += int(c)*table[n-1-i]*table2[i]
    ans %= mod
print(ans)
0