-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOVID19B.cpp
More file actions
32 lines (30 loc) · 692 Bytes
/
Copy pathCOVID19B.cpp
File metadata and controls
32 lines (30 loc) · 692 Bytes
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
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll t;
cin >> t;
while(t--){
ll n;
cin >> n;
ll* arr = new ll[n];
for(ll i = 0; i < n; i++){
cin >> arr[i];
}
ll* dp = new ll[n];
for(int i = 0; i < n; i++){
dp[i] = 1;
}
ll men = INT_MAX, mex = INT_MIN;
for(ll i = 1; i < n; i++){
for(int j = 0; j < i; i++){
if(arr[j] > arr[i]){
++dp[i];
}
}
mex = max(mex, dp[i]);
men = min(men, dp[i]);
}
cout << men<< " " << mex<<endl;
}
}