結果
問題 |
No.1580 I like Logarithm!
|
ユーザー |
|
提出日時 | 2021-12-03 06:49:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 197 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-07-05 10:40:21 |
合計ジャッジ時間 | 5,176 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 19 RE * 20 |
ソースコード
A = int(input()) B = input() mod = 10**9 + 7 N = len(B) b = int(B,A) ans = (b - pow(A,N-1)+1)*(N-1)%mod for j in range(1,N-1): ans += j*(pow(A,j+1,mod) - pow(A,j,mod)) ans %= mod print(ans)