alphacademy-cpp/quito/Kefa.cpp
2023-01-20 15:46:04 +01:00

30 lines
527 B
C++

#include <bits/stdc++.h>
using namespace std;
int main () {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
int streak = 1;
int maxstreak = 1;
for (int i = 1; i<n ;i++) {
if (v[i-1] <= v[i]) {
streak++;
} else {
if (streak>maxstreak) {
maxstreak = streak;
}
streak = 1;
}
}
if (streak>maxstreak) {
maxstreak = streak;
}
cout<<maxstreak;
}