|
||||||||||
Cute TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 580 Accepted Submission(s): 340 Problem Description Given the pseudo-code of a function $Build-Tree(A,id,L,R)$: where $A$ is given in input, $id$ is the number of node, $L$ ,$R$ is the left position and the right position of $A$ Require the number of nodes created by $Build-Tree(A,root,1,n)$. Input The first line contains an integer $T$ $(1\leq T\leq 5)$ representing the number of test cases. For each test case, the first contain one integer $n(1 \le n \le 2*10^5)$. The second line contain n integers $A_i$$(1 \le A_i \le 10^9)$. Output For each test output one line, the number of nodes created by $Build-Tree(A,root,1,n)$. Sample Input
Sample Output
Source | ||||||||||
|