結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,356 KB
testcase_01 AC 16 ms
7,956 KB
testcase_02 AC 17 ms
7,916 KB
testcase_03 AC 17 ms
7,960 KB
testcase_04 AC 16 ms
8,088 KB
testcase_05 AC 16 ms
7,916 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 16 ms
8,088 KB
testcase_09 RE -
testcase_10 AC 150 ms
7,960 KB
testcase_11 AC 1,951 ms
8,324 KB
testcase_12 TLE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 15 ms
8,056 KB
testcase_17 AC 15 ms
7,980 KB
testcase_18 AC 16 ms
7,984 KB
testcase_19 AC 15 ms
7,980 KB
testcase_20 AC 16 ms
7,912 KB
testcase_21 AC 16 ms
8,104 KB
testcase_22 AC 15 ms
8,052 KB
testcase_23 AC 16 ms
8,080 KB
testcase_24 AC 16 ms
8,088 KB
testcase_25 AC 16 ms
7,972 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, MOD))+1
    else:
        now *= A
    ans = (ans+i*now % MOD) % MOD

print(ans)
0