結果

問題 No.1580 I like Logarithm!
ユーザー convexineqconvexineq
提出日時 2021-07-03 05:16:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 212 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 76,396 KB
最終ジャッジ日時 2023-09-12 10:56:36
合計ジャッジ時間 5,544 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,332 KB
testcase_01 AC 72 ms
71,352 KB
testcase_02 AC 71 ms
71,268 KB
testcase_03 AC 72 ms
71,044 KB
testcase_04 AC 71 ms
71,132 KB
testcase_05 AC 72 ms
71,112 KB
testcase_06 AC 79 ms
76,252 KB
testcase_07 AC 77 ms
76,036 KB
testcase_08 AC 70 ms
71,040 KB
testcase_09 AC 75 ms
76,060 KB
testcase_10 AC 76 ms
76,224 KB
testcase_11 AC 78 ms
76,396 KB
testcase_12 AC 77 ms
76,260 KB
testcase_13 AC 76 ms
76,124 KB
testcase_14 AC 77 ms
75,976 KB
testcase_15 AC 78 ms
76,340 KB
testcase_16 AC 70 ms
71,276 KB
testcase_17 AC 70 ms
71,112 KB
testcase_18 AC 70 ms
71,244 KB
testcase_19 AC 71 ms
71,296 KB
testcase_20 AC 70 ms
71,044 KB
testcase_21 AC 70 ms
71,256 KB
testcase_22 AC 71 ms
71,200 KB
testcase_23 AC 72 ms
71,304 KB
testcase_24 AC 71 ms
71,180 KB
testcase_25 AC 71 ms
71,264 KB
testcase_26 AC 79 ms
76,072 KB
testcase_27 AC 80 ms
76,108 KB
testcase_28 AC 80 ms
76,104 KB
testcase_29 AC 80 ms
76,128 KB
testcase_30 AC 79 ms
75,828 KB
testcase_31 AC 79 ms
75,972 KB
testcase_32 AC 78 ms
76,236 KB
testcase_33 AC 79 ms
76,292 KB
testcase_34 AC 79 ms
76,128 KB
testcase_35 AC 79 ms
76,036 KB
testcase_36 AC 80 ms
76,284 KB
testcase_37 AC 80 ms
75,820 KB
testcase_38 AC 78 ms
76,260 KB
testcase_39 AC 77 ms
76,112 KB
testcase_40 AC 77 ms
76,148 KB
testcase_41 AC 78 ms
75,968 KB
testcase_42 AC 79 ms
76,108 KB
testcase_43 AC 78 ms
76,064 KB
testcase_44 AC 77 ms
75,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9+7
a = int(input())
b = input()
n = len(b)
ans = 0
r = 1
for i in range(n-1):
    ans += i*r*(a-1)%MOD
    r = r*a%MOD
v = 0
for i in map(int,b):
    v = (v*a+i)%MOD
ans += (n-1)*(v-r+1)
print(ans%MOD)
0