結果

問題 No.1580 I like Logarithm!
ユーザー ntudantuda
提出日時 2021-09-07 12:22:04
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 243 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 79,412 KB
最終ジャッジ日時 2023-08-24 20:13:41
合計ジャッジ時間 8,262 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,008 KB
testcase_01 AC 71 ms
71,256 KB
testcase_02 AC 71 ms
71,128 KB
testcase_03 AC 72 ms
70,976 KB
testcase_04 AC 71 ms
71,192 KB
testcase_05 AC 71 ms
71,420 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 70 ms
71,420 KB
testcase_09 RE -
testcase_10 AC 75 ms
75,580 KB
testcase_11 AC 76 ms
75,580 KB
testcase_12 AC 76 ms
75,868 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 71 ms
71,252 KB
testcase_17 AC 71 ms
71,344 KB
testcase_18 AC 70 ms
71,220 KB
testcase_19 AC 70 ms
71,368 KB
testcase_20 AC 72 ms
71,216 KB
testcase_21 AC 71 ms
71,316 KB
testcase_22 AC 69 ms
71,232 KB
testcase_23 AC 69 ms
71,188 KB
testcase_24 AC 70 ms
71,384 KB
testcase_25 AC 70 ms
70,984 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 AC 77 ms
75,696 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 75 ms
75,640 KB
testcase_36 AC 75 ms
75,584 KB
testcase_37 RE -
testcase_38 AC 75 ms
75,484 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 76 ms
75,684 KB
testcase_43 RE -
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

A = int(input())
B = input()
DB = int(B,A)
m = len(B)
AA = 1
mod = 10 ** 9 + 7
ans = 0
for i in range(1,m):
    AA = (AA * A) % mod
    ans = (ans - AA) % mod
ans = (ans + (m-1) * AA) % mod
ans = (ans + (m -1) * (DB - AA +1)) % mod
print(ans)
0