結果

問題 No.1580 I like Logarithm!
ユーザー titiatitia
提出日時 2021-07-02 22:28:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 596 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 8,440 KB
最終ジャッジ日時 2023-09-11 22:42:46
合計ジャッジ時間 16,306 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,968 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 15 ms
7,736 KB
testcase_03 AC 16 ms
7,804 KB
testcase_04 AC 15 ms
7,952 KB
testcase_05 AC 15 ms
7,784 KB
testcase_06 AC 240 ms
8,172 KB
testcase_07 AC 544 ms
8,424 KB
testcase_08 AC 17 ms
7,852 KB
testcase_09 AC 48 ms
7,860 KB
testcase_10 AC 79 ms
7,776 KB
testcase_11 AC 343 ms
8,160 KB
testcase_12 AC 379 ms
8,224 KB
testcase_13 AC 300 ms
8,308 KB
testcase_14 AC 550 ms
8,312 KB
testcase_15 AC 438 ms
8,376 KB
testcase_16 AC 15 ms
7,784 KB
testcase_17 AC 16 ms
7,836 KB
testcase_18 AC 14 ms
7,992 KB
testcase_19 AC 15 ms
7,816 KB
testcase_20 AC 15 ms
7,848 KB
testcase_21 AC 15 ms
7,820 KB
testcase_22 AC 15 ms
7,880 KB
testcase_23 AC 15 ms
7,968 KB
testcase_24 AC 15 ms
7,784 KB
testcase_25 AC 16 ms
7,820 KB
testcase_26 AC 594 ms
8,308 KB
testcase_27 AC 588 ms
8,312 KB
testcase_28 AC 583 ms
8,404 KB
testcase_29 AC 587 ms
8,440 KB
testcase_30 AC 591 ms
8,380 KB
testcase_31 AC 587 ms
8,320 KB
testcase_32 AC 574 ms
8,424 KB
testcase_33 AC 592 ms
8,284 KB
testcase_34 AC 592 ms
8,324 KB
testcase_35 AC 536 ms
8,308 KB
testcase_36 AC 539 ms
8,364 KB
testcase_37 AC 561 ms
8,436 KB
testcase_38 AC 579 ms
8,324 KB
testcase_39 AC 590 ms
8,312 KB
testcase_40 AC 587 ms
8,232 KB
testcase_41 AC 592 ms
8,400 KB
testcase_42 AC 585 ms
8,440 KB
testcase_43 AC 596 ms
8,404 KB
testcase_44 AC 589 ms
8,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

A=int(input())
B=input().strip()
mod=10**9+7

X=len(B)-1
CX=0

for i in range(len(B)):
    j=len(B)-1-i
    CX+=pow(A,i,mod)*int(B[j])

CX-=pow(A,X,mod)
ANS=(CX+1)*X%mod

#print(ANS,CX)

for i in range(X):
    ANS+=i*(pow(A,i+1,mod)-pow(A,i,mod))

print(ANS%mod)



0