#P7330. 「MCOI-07」Dream Fourier Transform
「MCOI-07」Dream Fourier Transform
Description
Dream has a sequence of length .
Dream needs to support two operations:
1 i x: multiply by .2 k: set , and compute
Because of the war, Dream cannot provide the sequence . He can only predict the operations he will perform. Please construct a “Dream program” that reads the array and outputs the answers to the corresponding queries.
Input Format
The first line contains two positive integers, representing and .
The next lines each describe an operation, in the form 1 i x or 2 k.
Output Format
The first line contains a non-negative integer , representing the length of the constructed Dream program.
The next lines each describe an operation.
You must ensure that .
3 3
2 0
1 1 108616
2 114514
15
>
>
>
+ 0 1
+ 3 2
< 4
S 108616
S 716372446
* 1 6
* 8 7
* 7 7
* 2 10
+ 0 9
+ 12 11
< 13
Hint
Warm reminder
$$63912897\equiv3^{\frac{998244352}{2^{12}}}\pmod{998244353}$$Sample explanation
When the Dream program input is the sequence [1,2,3], the output is the sequence [6,347675984], which meets the requirements.
Constraints and conventions
This problem uses bundled testdata.
- Subtask 1 (11 pts):
- Subtask 2 (19 pts): all query operations are after all update operations.
- Subtask 3 (23 pts):
- Subtask 4 (47 pts): no special constraints.
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号