Skip to content

Commit

Permalink
Add 14659.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Feb 7, 2024
1 parent 9d9e23f commit 40ca206
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 14xxx/14659.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

void solve(void) {
int n; cin >> n;
vector<int> v(n);
for (int i=0; i<n; i++) cin >> v[i];

int ans = 0;
for (int i=0; i<n-1; i++) {
int cnt = 0;
for (int j=i+1; j<n; j++) {
if (v[i] < v[j]) break;
cnt++;
}
ans = max(ans, cnt);
}
cout << ans;
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit 40ca206

Please sign in to comment.