#P17465. Bell 级数练习题
Bell 级数练习题
Background
::::info[Concept Explanation]{open} For a positive integer , define the set
$$\mathcal D(N)=\left\{\left\lfloor\frac Nd\right\rfloor:1\le d\le N\right\}$$Sort the numbers in in increasing order as .
Let be the prefix sum function of . In this problem, the block sieve of is defined as the following vector:
$$\mathbf B_f(N)=\left(F(d_1),F(d_2),\ldots,F(d_K)\right)$$::::
Problem Description
You need to dynamically maintain the block sieve of a multiplicative function .
More specifically, you are initially given the range and the values of at all prime powers not exceeding . Then there will be operations, and each operation is one of the following two types:
- Given a prime , modify the point values of .
- Query the block sieve of .
To avoid too much output, for a “query the block sieve of ” operation, you only need to compute the following function:
$$S_f(N)=\bigoplus_{x\in\mathcal D(N)} x\left(F(x)\bmod 998244353\right)$$Input Format
The first line contains two positive integers .
In the next lines, in the -th line there are integers, where the -th number is . Here is the -th prime in increasing order.
In the next lines, each line contains several integers. The first integer indicates the type of the operation:
- If , the next integer is the prime to be modified, followed by integers, which are the new values of in order.
- If , you need to output the current value of .
Output Format
Output several lines, each containing one non-negative integer, representing the value of for each query.
6 5
1 1
1
1
2
1 2 0 2
2
1 3 0
2
40
27
24
Hint
For of the testdata, .
For another of the testdata, all operations with have the same .
For of the testdata, , , , and is prime, and any given satisfies .
The time limit is about times the running time of std on the slowest case.
Translated by ChatGPT 5