-
Notifications
You must be signed in to change notification settings - Fork 0
/
DAYSO004.cpp
43 lines (42 loc) · 946 Bytes
/
DAYSO004.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @file DAYSO004.cpp
* @author long ([email protected])
* @brief the longest increase sub-array
* @version 0.1
* @date 2023-04-02
*
* @copyright Copyright (c) 2023
*
*/
#include <iostream>
#define MAX 100000
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int n, max{0}, count{1}, arr[MAX];
cin >> n;
for(int i=0; i<n; i++) {
cin >> arr[i];
}
int ind_prev, ind_curr;
for(int i=0; i<n-1; i++) {
ind_prev = i;
for(int j = i+1; j < n; j++) {
ind_curr = j;
if(arr[ind_prev] < arr[ind_curr]) {
count++;
ind_prev = ind_curr;
} else {
continue;
}
}
if(max < count) {
max = count;
}
count = 1;
}
cout << max << endl;
}
}