結果
問題 |
No.1580 I like Logarithm!
|
ユーザー |
|
提出日時 | 2021-07-02 22:42:24 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 574 bytes |
コンパイル時間 | 132 ms |
コンパイル使用メモリ | 82,272 KB |
実行使用メモリ | 85,140 KB |
最終ジャッジ日時 | 2024-06-29 12:34:17 |
合計ジャッジ時間 | 3,795 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | TLE * 1 -- * 38 |
ソースコード
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])*pow(n,(i-1),mod) out %= mod return out#int out ############################ print((ans + (len(b) - 1) * (Base_n_to_10("".join(list(map(str, b[1:]))), a) + 1)) % mod)