結果

問題 No.1580 I like Logarithm!
ユーザー ntudantuda
提出日時 2021-09-06 21:53:24
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 220 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,168 KB
実行使用メモリ 67,644 KB
最終ジャッジ日時 2024-06-02 03:28:36
合計ジャッジ時間 3,824 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,440 KB
testcase_01 AC 34 ms
52,384 KB
testcase_02 AC 34 ms
52,924 KB
testcase_03 AC 34 ms
52,684 KB
testcase_04 AC 35 ms
53,492 KB
testcase_05 AC 33 ms
52,972 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 34 ms
53,424 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 36 ms
52,824 KB
testcase_17 AC 34 ms
52,304 KB
testcase_18 AC 34 ms
51,996 KB
testcase_19 AC 32 ms
52,168 KB
testcase_20 AC 32 ms
52,572 KB
testcase_21 AC 33 ms
51,948 KB
testcase_22 AC 32 ms
52,360 KB
testcase_23 AC 31 ms
52,544 KB
testcase_24 AC 32 ms
53,276 KB
testcase_25 AC 34 ms
53,832 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

A = int(input())
B = int(input())
B= int(str(B),A)
i = 0
x = 1
j = A
ans = 0
mod = 10 ** 9 + 7
while x * A <= B:
    ans = (ans + (A-1) * x * i) % mod
    i += 1
    x *= A
ans = (ans + (B - x + 1) * i) % mod

print(ans)
0