結果

問題 No.1580 I like Logarithm!
ユーザー yudai1102jpyudai1102jp
提出日時 2021-07-02 22:36:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 288 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 12,944 KB
最終ジャッジ日時 2023-09-11 22:57:03
合計ジャッジ時間 9,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,352 KB
testcase_01 AC 16 ms
7,964 KB
testcase_02 AC 16 ms
7,972 KB
testcase_03 AC 15 ms
7,956 KB
testcase_04 AC 16 ms
8,052 KB
testcase_05 AC 16 ms
7,840 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 16 ms
7,884 KB
testcase_09 RE -
testcase_10 AC 153 ms
7,896 KB
testcase_11 AC 1,965 ms
8,436 KB
testcase_12 TLE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 16 ms
8,048 KB
testcase_17 AC 16 ms
7,992 KB
testcase_18 AC 16 ms
7,968 KB
testcase_19 AC 16 ms
7,904 KB
testcase_20 AC 17 ms
7,904 KB
testcase_21 AC 16 ms
7,884 KB
testcase_22 AC 16 ms
7,984 KB
testcase_23 AC 16 ms
8,068 KB
testcase_24 AC 16 ms
7,972 KB
testcase_25 AC 16 ms
7,832 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 TLE -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A = int(input())

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

MOD = 10**9+7

# logB = int(math.log(B, A))
ans = 0
now = (A-1)
for i in range(1, logB+1):
    if i == logB:
        now = B-(pow(A, logB))+1
    else:
        now *= A
    ans = (ans+i*now % MOD) % MOD

print(ans)
0