#P7334. [JRKSJ R1] 吊打
[JRKSJ R1] 吊打
Description
You are given a positive integer sequence of length . Then there are operations of two types:
1 l rmeans taking the square root of and rounding down, that is, set $\forall i\in [l,r],a_i\gets\lfloor\sqrt{a_i}\rfloor$;2 l rmeans squaring , that is, set .
After all operations are finished, output .
Since the answer may be very large, you only need to output it modulo .
Input Format
The input has lines.
The first line contains two positive integers .
The second line contains positive integers .
The next lines each contain positive integers describing one operation.
Output Format
Output one line with one integer, the answer modulo .
1 1
1
1 1 1
1
4 2
1 2 3 4
1 2 4
2 1 4
7
5 5
10 8 10 11 12
2 1 5
1 1 5
1 1 4
2 4 5
1 1 5
18
Hint
Constraints
| Test Point | Special Restriction |
|---|---|
Guarantee that for any 1 l r operation, the previous operation is 2 l r |
|
Guarantee that there are only 1 operations |
|
Guarantee that there are only 2 operations |
|
| Guarantee that all and | |
| No special restrictions |
For all testdata, it is guaranteed that and .
Translated by ChatGPT 5
京公网安备 11011102002149号