a.题目链接
b.题解
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int>a(n,0);
for(auto&i:a)cin >> i;
int max_1 = a[0];
int min_1 = a[0];
int cnt = 0;
for(int i = 1; i<n; i++){
if(a[i]>max_1){
cnt++;
max_1 = a[i];
}else if(a[i] < min_1){
cnt++;
min_1 = a[i];
}
}
cout << cnt;
return 0;
}
//水题