https://ac.nowcoder.com/acm/contest/330/H

C++版本一

题解:

std

参考文章:https://blog.csdn.net/weixin_43272781/article/details/85311412

 

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
const int maxn = 1 << 20;
const int mod = 1e9 + 7;
 
ll Pow(ll a, ll n = mod - 2)
{
    ll t = 1;
    for (; n; n >>= 1, (a *= a) %= mod)
        if (n & 1) (t *= a) %= mod;
    return t;
}
 
int main()
{
    ll _ = Pow(100);
    int n, k, x;
    scanf("%d%d%d", &n, &k, &x);
    ll ans = 0;
    ll C = 1;
    for (int i = 0; i < k; i++)
    {
        ll p = (99 - x) * _ % mod;
        ans = ans + Pow(p, n - i - 1) * Pow(mod + 1 - p, i) % mod * C % mod;
        ans %= mod;
        C = C * (n - 1 - i) % mod * Pow(i + 1) % mod;
    }
    printf("%lld\n", ans);
}