Applese 的大奖
生活随笔
收集整理的這篇文章主要介紹了
Applese 的大奖
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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); }?
總結
以上是生活随笔為你收集整理的Applese 的大奖的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Applese 的毒气炸弹
- 下一篇: Applese 的回文串