結果

問題 No.1580 I like Logarithm!
ユーザー KudeKude
提出日時 2021-07-02 22:14:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 76,556 KB
最終ジャッジ日時 2023-09-11 22:18:47
合計ジャッジ時間 5,837 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,332 KB
testcase_01 AC 75 ms
71,132 KB
testcase_02 AC 78 ms
71,288 KB
testcase_03 AC 74 ms
71,476 KB
testcase_04 AC 73 ms
71,104 KB
testcase_05 AC 75 ms
71,380 KB
testcase_06 AC 80 ms
76,260 KB
testcase_07 AC 81 ms
76,304 KB
testcase_08 AC 75 ms
71,140 KB
testcase_09 AC 81 ms
76,188 KB
testcase_10 AC 79 ms
76,260 KB
testcase_11 AC 81 ms
76,368 KB
testcase_12 AC 82 ms
76,108 KB
testcase_13 AC 82 ms
76,208 KB
testcase_14 AC 84 ms
76,240 KB
testcase_15 AC 82 ms
76,240 KB
testcase_16 AC 75 ms
71,384 KB
testcase_17 AC 75 ms
71,136 KB
testcase_18 AC 75 ms
71,308 KB
testcase_19 AC 75 ms
71,336 KB
testcase_20 AC 74 ms
71,448 KB
testcase_21 AC 73 ms
71,372 KB
testcase_22 AC 75 ms
71,136 KB
testcase_23 AC 74 ms
71,244 KB
testcase_24 AC 72 ms
71,096 KB
testcase_25 AC 73 ms
71,136 KB
testcase_26 AC 80 ms
76,452 KB
testcase_27 AC 82 ms
76,200 KB
testcase_28 AC 83 ms
75,976 KB
testcase_29 AC 82 ms
76,360 KB
testcase_30 AC 83 ms
76,332 KB
testcase_31 AC 82 ms
76,244 KB
testcase_32 AC 82 ms
76,312 KB
testcase_33 AC 82 ms
76,372 KB
testcase_34 AC 81 ms
76,556 KB
testcase_35 AC 81 ms
76,368 KB
testcase_36 AC 80 ms
76,244 KB
testcase_37 AC 81 ms
76,116 KB
testcase_38 AC 82 ms
76,196 KB
testcase_39 AC 82 ms
76,276 KB
testcase_40 AC 83 ms
76,376 KB
testcase_41 AC 82 ms
76,376 KB
testcase_42 AC 83 ms
76,264 KB
testcase_43 AC 80 ms
75,984 KB
testcase_44 AC 82 ms
76,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
a = int(input())
b = input()
ans = 0
d = a - 1
for k in range(len(b) - 1):
    ans = (ans + k * d) % MOD
    d = d * a % MOD
x = int(b[0]) - 1
for c in b[1:]:
    x = (a * x + int(c)) % MOD
ans = (ans + (len(b) - 1) * (x + 1)) % MOD
print(ans)
0