longest increasing sequence


Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

題目說明

輸入一連串個數未定的整數,當遇到輸入值為0則視為輸入結束,程式輸出最長連續嚴格遞增數列的長度。所謂的連續嚴格遞增數列為一個數列中的每個數字都大於前面緊鄰的數字,例如1 2 5,因為1 < 2 < 5。但1 2 2 5則不符合,因為1 < 2 = 2 < 5。

輸入資料限制:輸入數字都是整數,最小值為0,最大值為1000。

輸入

一連串的整數

輸出

最長連續嚴格遞增數列的長度

sample input1

5 6 7 0 8

sample output1

3

sample input2

7 6 5 0 6

sample output2

1

sample input3

1 2 3 2 1 0 4

sample output3

3

sample input4

1 2 1 2 0 1 2 3

sample output4

2

sample input5

1 1 1 0 2

sample output5

1

sample input6

0 1 2

sample output6

0

Comments