結果
問題 | No.1580 I like Logarithm! |
ユーザー |
👑 ![]() |
提出日時 | 2021-07-02 22:10:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 324 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 67,456 KB |
最終ジャッジ日時 | 2024-06-29 11:45:59 |
合計ジャッジ時間 | 3,753 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 39 |
ソースコード
"""A = 10だと1からBまでの桁数i桁目"""A = int(input())B = input()mod = 10**9+7tenb = 0for i in B:tenb *= Atenb += ord(i) - ord('0')tenb %= modans = tenb * len(B)#print (ans)sml = 0for i in range(len(B)):sub = pow(A,i,mod) - 1#print (i,sub)ans -= subprint ((ans-tenb) % mod)"""tenb = 0ans = 0for i in B:tenb *= Atenb %= modans += tenbans %= modtenb += ord(i) - ord('0')"""