結果
| 問題 | No.1580 I like Logarithm! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-02 22:39:38 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 469 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 31,836 KB |
| 最終ジャッジ日時 | 2026-03-19 00:16:55 |
| 合計ジャッジ時間 | 83,342 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 13 TLE * 26 |
ソースコード
a = int(input())
b = list(map(int, list(input())))
ans = 0
mod = 10 ** 9 + 7
for i in range(1, len(b)):
if i != len(b) - 1:
ans += i * pow(a, i) * (a - 1)
ans %= mod
else:
ans += i * (b[-(i + 1)] - 1) * pow(a, i)
ans %= mod
########関数部分##############
def Base_n_to_10(X,n):
out = 0
for i in range(1,len(str(X))+1):
out += int(X[-i])*(n**(i-1))
out %= mod
return out#int out
############################
print((ans + (len(b) - 1) * (Base_n_to_10("".join(list(map(str, b[1:]))), a) + 1)) % mod)