【发布时间】:2017-04-12 10:31:39
【问题描述】:
问题链接
http://codeforces.com/contest/615/problem/D 解决方案的链接是 http://codeforces.com/contest/615/submission/15260890
在下面的代码中,我无法理解为什么从 mod 中减去 1 其中 mod=1000000007
ll d = 1;
ll ans = 1;
for (auto x : cnt) {
ll cnt = x.se;
ll p = x.fi;
ll fp = binPow(p, (cnt + 1) * cnt / 2, MOD);
ans = binPow(ans, (cnt + 1), MOD) * binPow(fp, d, MOD) % MOD;
d = d * (x.se + 1) % (MOD - 1);//why ??
}
【问题讨论】:
-
其他人也不太可能知道,因为您还没有指出这段代码应该做什么。
-
现在,我添加解决方案和问题的链接
-
欢迎来到 Stack Overflow!您可以阅读如何How to Ask 一个问题并创建一个minimal reproducible example。这让我们更容易为您提供帮助。
标签: math numbers primes number-theory mod