当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6340:Problem I. Delightful Formulas

题目描述
Kazari is too bored this summer holiday, she decides to play with formulas.
First of all, she comes up with two positive integers $N, K$.
She loves power, therefore she builds a sequence $a$ where $a_i = i ^ K$ $(1 \le i \le N)$.
She loves summation, therefore she calculate the partial sum of $a$ as $s$, i.e. $s_i = \sum_{j \le i} {a_j}$ $(1 \le i \le N)$.
She also loves coprimes, therefore she calculate the sum of elements in $s$ whose index $i$ is coprime to $N$, i.e. $v = \sum_{1 \le i \le N, \gcd(i, N) = 1} {s_i}$
Your task is to work out $v$. Since the answer is too large, print it modulo $998244353$.
输入解释
The first line of the input contains an integer $T$ denoting the number of test cases.
Each test case starts with a positive integer $K$ $(K \le 10 ^ 5, \sum{K} \le 10 ^ 6)$.
The second line contains a positive integer $m$ $(m \le 20)$, indicating the number of distinct primes of $N$.
Each of next $m$ lines contains two positive integers $p_i, a_i$ where $p_i$ is a prime $(p_i, a_i \le 10 ^ 9, p_i < p_{i + 1})$.
$$N = \prod_{i = 1} ^ {m} {p_i ^ {a_i}}$$
输出解释
For each test case, print an integer representing the answer modulo $998244353$.
输入样例
2
1
2
2 1
3 1
233
1
23333 1
输出样例
16
32727388
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6340

最后修改于 2020-10-25T23:30:26+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 262144/262144K(Java/Others)