結果

問題 No.1580 I like Logarithm!
ユーザー 👑 KazunKazun
提出日時 2021-07-02 21:50:04
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 223 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 78,608 KB
最終ジャッジ日時 2023-09-11 21:40:55
合計ジャッジ時間 6,648 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,280 KB
testcase_01 AC 68 ms
71,312 KB
testcase_02 AC 68 ms
71,228 KB
testcase_03 AC 68 ms
71,244 KB
testcase_04 AC 72 ms
70,916 KB
testcase_05 AC 69 ms
71,300 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 69 ms
71,036 KB
testcase_09 RE -
testcase_10 AC 72 ms
75,836 KB
testcase_11 AC 75 ms
75,672 KB
testcase_12 AC 75 ms
75,808 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 68 ms
71,192 KB
testcase_17 AC 68 ms
71,136 KB
testcase_18 AC 68 ms
71,284 KB
testcase_19 AC 68 ms
71,284 KB
testcase_20 AC 68 ms
70,936 KB
testcase_21 AC 68 ms
71,352 KB
testcase_22 AC 68 ms
71,072 KB
testcase_23 AC 69 ms
71,000 KB
testcase_24 AC 67 ms
71,020 KB
testcase_25 AC 67 ms
71,280 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 AC 70 ms
75,604 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 73 ms
75,664 KB
testcase_36 AC 74 ms
75,760 KB
testcase_37 RE -
testcase_38 AC 74 ms
75,784 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 76 ms
75,752 KB
testcase_43 RE -
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

A=int(input())
B=input()
Mod=10**9+7

digit=len(B)

X=0
T=1
S=A
for k in range(digit-1):
    X+=k*(S-T)
    X%=Mod

    S*=A
    S%=Mod

    T*=A
    T%=Mod

BB=int(B,base=A)
BB%=Mod

X+=(digit-1)*(BB-T+1)
X%=Mod

print(X)
0