結果
| 問題 | No.1417 100の倍数かつ正整数(2) | 
| コンテスト | |
| ユーザー |  Nachia | 
| 提出日時 | 2021-03-05 22:40:28 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 751 bytes | 
| コンパイル時間 | 4,167 ms | 
| コンパイル使用メモリ | 250,636 KB | 
| 最終ジャッジ日時 | 2025-01-19 11:35:54 | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 28 WA * 7 RE * 1 | 
ソースコード
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
using mll=atcoder::static_modint<1000000007>;
string N;
mll dp1[10001][100];
mll dp[10001][100];
mll dpf[10001][100];
int main(){
  cin>>N;
  int n=N.size();
  rep(i,n+1) rep(j,100) dp1[i][j]=dp[i][j]=dpf[i][j]=0;
  mll ans=0;
  dp1[0][1]=1;
  rep(i,n-1){
    for(int x=1; x<=9; x++) rep(t,100) dp1[i+1][t*x%100]+=dp1[i][t];
    ans+=dp1[i+1][0];
  }
  dpf[0][1]=1;
  rep(i,n){
    int d=N[n-1-i]-'0';
    if(d!=0) rep(t,100) dp[i+1][t*d%100]+=dp[i][t];
    for(int x=1; x<d; x++) rep(t,100) dp[i+1][t*x%100]+=dp1[i][t];
  }
  ans+=dp[n][0];
  printf("%u\n",ans.val());
  return 0;
}
            
            
            
        