kefa fixed

This commit is contained in:
kaoplo 2023-01-20 15:46:04 +01:00
parent 584d46bb84
commit e03982bc25
2 changed files with 15 additions and 16 deletions

Binary file not shown.

View file

@ -4,28 +4,27 @@ using namespace std;
int main () { int main () {
int n; int n;
cin >> n; cin >> n;
vector<int> szamok(n);
vector<int> v(n);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
cin >> szamok[i]; cin >> v[i];
} }
int streak =1; int streak = 1;
int maxstreak =0; int maxstreak = 1;
for (int i = 0; i < n; i++) { for (int i = 1; i<n ;i++) {
if (i != 0) { if (v[i-1] <= v[i]) {
if (szamok[i-1] <= szamok[i]) { streak++;
streak++; } else {
//cout<<szamok[i-1]<<'<'<<szamok[i]<<endl; if (streak>maxstreak) {
} else { maxstreak = streak;
if (streak > maxstreak) {
//cout<<"streakreset"<<endl;
maxstreak = streak;
streak= 1;
}
} }
streak = 1;
} }
} }
if (streak > maxstreak) { if (streak>maxstreak) {
maxstreak = streak; maxstreak = streak;
} }
cout<<maxstreak; cout<<maxstreak;
} }