#P5072. [Ynoi Easy Round 2015] 盼君勿忘
[Ynoi Easy Round 2015] 盼君勿忘
Description
Chtholly gives you a sequence. For each query, compute the sum of all subsequences in the interval after removing duplicates within each subsequence, and output the result .
Input Format
The first line contains two integers .
The second line contains integers representing the sequence.
Then follow lines, each containing three integers , describing the queried interval and the modulus.
Output Format
Output lines. Each line contains one integer, the answer.
5 5
1 2 2 3 4
1 2 233333
2 3 333333
1 5 5
3 5 15
2 4 8
6
6
1
6
0
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477.
Constraints: For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号