結果

問題 No.1580 I like Logarithm!
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-12-03 06:49:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 197 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 8,436 KB
最終ジャッジ日時 2023-09-18 21:27:02
合計ジャッジ時間 5,906 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,832 KB
testcase_01 AC 17 ms
7,872 KB
testcase_02 AC 15 ms
7,836 KB
testcase_03 AC 15 ms
7,764 KB
testcase_04 AC 15 ms
7,856 KB
testcase_05 AC 15 ms
7,868 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 16 ms
7,804 KB
testcase_09 RE -
testcase_10 AC 55 ms
7,848 KB
testcase_11 AC 226 ms
8,244 KB
testcase_12 AC 245 ms
8,316 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 14 ms
7,900 KB
testcase_17 AC 15 ms
7,872 KB
testcase_18 AC 15 ms
7,872 KB
testcase_19 AC 15 ms
7,896 KB
testcase_20 AC 15 ms
7,868 KB
testcase_21 AC 15 ms
7,808 KB
testcase_22 AC 15 ms
7,864 KB
testcase_23 AC 15 ms
7,796 KB
testcase_24 AC 15 ms
7,900 KB
testcase_25 AC 16 ms
7,952 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 AC 376 ms
8,256 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 349 ms
8,248 KB
testcase_36 AC 351 ms
8,260 KB
testcase_37 RE -
testcase_38 AC 365 ms
8,312 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 384 ms
8,416 KB
testcase_43 RE -
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

A = int(input())
B = input()
mod = 10**9 + 7
N = len(B)
b = int(B,A)
ans = (b - pow(A,N-1)+1)*(N-1)%mod
for j in range(1,N-1):
    ans += j*(pow(A,j+1,mod) - pow(A,j,mod))
    ans %= mod
print(ans)
0