結果

問題 No.1580 I like Logarithm!
ユーザー ああいいああいい
提出日時 2022-03-15 19:50:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 71,844 KB
最終ジャッジ日時 2023-10-23 18:13:16
合計ジャッジ時間 5,380 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,456 KB
testcase_01 AC 36 ms
53,456 KB
testcase_02 AC 37 ms
53,456 KB
testcase_03 AC 37 ms
53,456 KB
testcase_04 AC 37 ms
53,456 KB
testcase_05 AC 36 ms
53,456 KB
testcase_06 AC 47 ms
64,800 KB
testcase_07 AC 53 ms
71,748 KB
testcase_08 AC 40 ms
53,456 KB
testcase_09 AC 44 ms
60,048 KB
testcase_10 AC 45 ms
62,096 KB
testcase_11 AC 50 ms
68,504 KB
testcase_12 AC 51 ms
69,140 KB
testcase_13 AC 49 ms
67,888 KB
testcase_14 AC 53 ms
71,712 KB
testcase_15 AC 52 ms
69,888 KB
testcase_16 AC 36 ms
53,456 KB
testcase_17 AC 37 ms
53,456 KB
testcase_18 AC 37 ms
53,456 KB
testcase_19 AC 37 ms
53,456 KB
testcase_20 AC 37 ms
53,456 KB
testcase_21 AC 37 ms
53,456 KB
testcase_22 AC 38 ms
53,456 KB
testcase_23 AC 37 ms
53,456 KB
testcase_24 AC 37 ms
53,456 KB
testcase_25 AC 37 ms
53,456 KB
testcase_26 AC 54 ms
71,844 KB
testcase_27 AC 55 ms
71,844 KB
testcase_28 AC 55 ms
71,844 KB
testcase_29 AC 55 ms
71,844 KB
testcase_30 AC 54 ms
71,844 KB
testcase_31 AC 54 ms
71,844 KB
testcase_32 AC 54 ms
71,844 KB
testcase_33 AC 53 ms
71,844 KB
testcase_34 AC 53 ms
71,844 KB
testcase_35 AC 53 ms
71,844 KB
testcase_36 AC 55 ms
71,844 KB
testcase_37 AC 53 ms
71,844 KB
testcase_38 AC 54 ms
71,844 KB
testcase_39 AC 54 ms
71,844 KB
testcase_40 AC 53 ms
71,844 KB
testcase_41 AC 53 ms
71,844 KB
testcase_42 AC 53 ms
71,844 KB
testcase_43 AC 52 ms
71,844 KB
testcase_44 AC 53 ms
71,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A = int(input())
B = input()
l = list(map(int,list(B)))
n = len(l)
ans = 0
P = 10 ** 9 + 7
b = 0
beki = 1
for i in range(n):
    tmp = beki * A % P
    if i < n - 1:
        ans += (tmp - beki) % P * i % P
        ans %= P
    b = (b + beki * l[-1-i]) % P
    if i == n-1:
        ans = (ans + (b - beki + 1)*i) % P
    beki = tmp
print(ans)
0