結果
| 問題 | No.1580 I like Logarithm! | 
| コンテスト | |
| ユーザー |  kiyoshi0205 | 
| 提出日時 | 2021-07-02 21:53:58 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 381 bytes | 
| コンパイル時間 | 3,624 ms | 
| コンパイル使用メモリ | 230,620 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-29 11:26:03 | 
| 合計ジャッジ時間 | 5,437 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 4 | 
| other | AC * 10 WA * 29 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using mint=modint1000000007;
#define rep(i,N) for(int i=0;i<N;++i)
long long A,N;
string s;
mint ans;
int main(){
  cin>>A>>s;
  N=s.size();
  mint m=A;
  rep(i,N-1)ans+=(m.pow(i+1)-m.pow(i))*i;
  mint x;
  rep(i,N)x=x*10+s[i]-'0';
  ans+=(x-m.pow(N-1)+1)*(N-1);
  cout<<ans.val()<<endl;
}
            
            
            
        