[Solution] P6392
KaguyaH
·
·
题解
天依能吃到 p 个蛋挞呢。
我们把阿绫的模数 998344353 叫做 m 吧。
\begin{aligned}
p =& \left\lceil \frac k {25} \right\rceil \cdot 100 \bmod m\\
=& \left\lceil \frac k {25} \right\rceil \cdot 25 \cdot 4 \bmod m\\
=& (k + (25 - k \bmod 25) \bmod 25)) \cdot 4 \bmod m\\
=& (k \bmod m + (25 - k \bmod 25) \bmod 25)) \cdot 4 \bmod m,\\
\end{aligned}
k = 2^{a + 2} \cdot b.
```cpp
# define _CRT_SECURE_NO_WARNINGS
# include <cctype>
# include <cstdio>
namespace Main {
namespace Sourse {
typedef long unsigned int lu;
typedef long long unsigned int llu;
static inline llu read(const llu mod) {
char t; while (isspace(t = getchar()));
llu r(0); while (r = (r * 10 + (t - '0')) % mod, isdigit(t = getchar()));
return r;
}
namespace Maths {
static inline const lu qpow(llu b, llu e, const lu mod) {
b %= mod; llu r(1 % mod);
while (e) {
if (e bitand 1) r = 1ull * r * b % mod;
b = 1ull * b * b % mod, e >>= 1;
}
return r;
}
}
}
using namespace Sourse;
static const lu Mod(998344353);
static llu a;
static const llu b(read(Mod * 25ull));
static lu k, _k;
static inline const void main() {
scanf("%llu", &a);
k = b % Mod * Maths::qpow(2, a + 2, Mod) % Mod, _k = b % 25 * Maths::qpow(2, a + 2, 25) % 25;
printf("%lu\n", (k + (25 - _k) % 25) * 4 % Mod);
}
}
signed int main() { Main::main(); return 0; }
```
事翻任务计划翻到了一道 GLR Round 1,对这场比赛的主题印象很深,然后从比赛界面找到的题。
南北组好甜qwq
> 也只有女孩子能这么甜了罢()