|
||||||||||
LoversTime Limit: 25000/15000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1786 Accepted Submission(s): 544 Problem Description The Fool comes to a cross-road, filled with energy, confidence and purpose, knowing exactly where he wants to go and what he wants to do. But he comes to a dead stop. A flowering tree marks the path he wants to take, the one he’s been planning on taking. But standing before a fruit tree marking the other path is a woman. The Fool has met and had relationships with women before, some far more beautiful and alluring. But she is different. Seeing her, he feels as though he’s just been shot in the heart with cupid’s arrow. There are $n$ empty strings: You are required to perform two kinds of operations: Note that the value of an empty string is 0. Input The first line contains one integer $T$, which denote the number of cases. For each case, the first line contains two integer $n$ and $m$ where $n$ is the number of strings and $m$ is the number of operations. Each line of the following m lines contains an operation with format or Output For each case, you should output "Case $i$:"in a line, where $i$ is the case number starting from 1. Then for each query operation in that case, output a line that contains a single integer that representing the answer for that query operation. Sample Input
Sample Output
Hint 1 ≤ T ≤ 5, 1 ≤ n, m ≤ 1e5, 1 ≤ l ≤ r ≤ n. Source | ||||||||||
|