結果

問題 No.1580 I like Logarithm!
ユーザー yudai1102jpyudai1102jp
提出日時 2021-07-02 22:54:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 259 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 8,568 KB
最終ジャッジ日時 2023-09-11 23:20:36
合計ジャッジ時間 2,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,884 KB
testcase_01 AC 15 ms
7,932 KB
testcase_02 AC 15 ms
7,924 KB
testcase_03 AC 16 ms
8,000 KB
testcase_04 AC 16 ms
7,964 KB
testcase_05 AC 16 ms
7,924 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 16 ms
7,956 KB
testcase_09 RE -
testcase_10 AC 21 ms
7,940 KB
testcase_11 AC 39 ms
8,344 KB
testcase_12 AC 41 ms
8,328 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 16 ms
8,032 KB
testcase_17 AC 16 ms
8,020 KB
testcase_18 AC 16 ms
8,004 KB
testcase_19 AC 16 ms
7,960 KB
testcase_20 AC 16 ms
7,972 KB
testcase_21 AC 16 ms
7,972 KB
testcase_22 AC 16 ms
7,896 KB
testcase_23 AC 16 ms
8,088 KB
testcase_24 AC 16 ms
7,896 KB
testcase_25 AC 16 ms
8,056 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 AC 52 ms
8,464 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 51 ms
8,468 KB
testcase_36 AC 51 ms
8,324 KB
testcase_37 RE -
testcase_38 AC 53 ms
8,512 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 53 ms
8,340 KB
testcase_43 RE -
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A = int(input())

B = input()
L = len(B)-1
B = int(B, A)

MOD = 10**9+7

# logB = int(math.log(B, A))
ans = (B+1)*L % MOD

minus = 0
now = A
for i in range(1, 1+L):
    minus = (minus + now) % MOD
    now = (now*A) % MOD

print((ans-minus) % MOD)
0