alphacademy-cpp/quito/Kefa.cpp
2023-01-18 22:26:31 +01:00

31 lines
722 B
C++

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