Description
Velv was very happy these days because she finally solved the skiing problem !!!
Of course, she is not complacent. This time, she encountered another question about sports: Jump wooden stakes. The wooden jump is an ancient movement. Ancient tribes hold this kind of movement during Sacrifices and pray for peace. They arranged some tall wooden piles neatly in a straight line. Athletes must jump from left to right and only fall onto tall or tall wooden stakes (velv notices this is the opposite of skiing ).
Note: The wooden piles are placed very close, and the athletes selected from the tribe bounce very well. They can easily skip any Wooden Pile and safely fall onto the required wooden pile.
Finally, the referee judges who have trampled the most wooden piles to win.
-
Input
-
Multiple Input groups. The first positive integer t represents the number of groups.
The first row of each group has a positive integer N, 1 ≤ n ≤ 1000, indicating the number of wooden piles.
The second act is H1, H2 ,..., Hn contains N non-negative values (in the int32 range), indicating the height of the Wooden Pile arranged from left to right.
-
Output
-
The first line of each group outputs the maximum number of piles that can be trampled
-
Sample Input
-
231 2 352 5 3 6
-
Sample output
-
34
this question is to use greed to sort the height, from low to high
# include
using namespace STD; int H [1000]; int num [1000]; int main () {int t, n, I, j; CIN> T; while (t --) {CIN> N; for (I = 0; I
H [I]; num [I] = 1 ;}for (I = 1; I
J) J = num [I]; cout