結果

問題 No.1580 I like Logarithm!
ユーザー vwxyzvwxyz
提出日時 2023-12-08 05:30:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 14,208 KB
最終ジャッジ日時 2023-12-08 05:30:33
合計ジャッジ時間 6,726 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,856 KB
testcase_01 AC 29 ms
9,856 KB
testcase_02 AC 27 ms
9,856 KB
testcase_03 AC 28 ms
9,856 KB
testcase_04 AC 27 ms
9,856 KB
testcase_05 AC 27 ms
9,856 KB
testcase_06 AC 70 ms
11,776 KB
testcase_07 AC 125 ms
13,952 KB
testcase_08 AC 29 ms
9,984 KB
testcase_09 AC 36 ms
10,240 KB
testcase_10 AC 41 ms
10,496 KB
testcase_11 AC 87 ms
12,544 KB
testcase_12 AC 93 ms
12,800 KB
testcase_13 AC 85 ms
12,288 KB
testcase_14 AC 127 ms
13,952 KB
testcase_15 AC 106 ms
13,056 KB
testcase_16 AC 28 ms
9,856 KB
testcase_17 AC 30 ms
9,856 KB
testcase_18 AC 30 ms
9,856 KB
testcase_19 AC 29 ms
9,856 KB
testcase_20 AC 28 ms
9,856 KB
testcase_21 AC 28 ms
9,856 KB
testcase_22 AC 28 ms
9,856 KB
testcase_23 AC 29 ms
9,856 KB
testcase_24 AC 28 ms
9,856 KB
testcase_25 AC 27 ms
9,856 KB
testcase_26 AC 128 ms
14,208 KB
testcase_27 AC 128 ms
14,208 KB
testcase_28 AC 128 ms
14,208 KB
testcase_29 AC 128 ms
14,208 KB
testcase_30 AC 131 ms
14,208 KB
testcase_31 AC 126 ms
14,208 KB
testcase_32 AC 128 ms
14,208 KB
testcase_33 AC 131 ms
14,208 KB
testcase_34 AC 133 ms
14,208 KB
testcase_35 AC 131 ms
14,208 KB
testcase_36 AC 122 ms
14,208 KB
testcase_37 AC 133 ms
14,208 KB
testcase_38 AC 125 ms
14,208 KB
testcase_39 AC 127 ms
14,208 KB
testcase_40 AC 138 ms
14,208 KB
testcase_41 AC 130 ms
14,208 KB
testcase_42 AC 135 ms
14,208 KB
testcase_43 AC 136 ms
14,208 KB
testcase_44 AC 129 ms
14,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
from collections import defaultdict

A=int(readline())
B=readline().rstrip()[::-1]
mod=10**9+7
le=len(B)
powA=[1]
for i in range(1,le):
    powA.append(powA[-1]*A%mod)
s=sum(int(b)*powA[i]%mod for i,b in enumerate(B))
ans=0
for i in range(1,le):
    ans+=s-(powA[i]-1)
    ans%=mod
print(ans)
0