#include <bits/stdc++.h>
#define y1 theboatman
#define make_struct(args...) {args}
using namespace std;
int main() {
cin.tie(0);
ios :: sync_with_stdio(0);
int n;
cin >> n;
vector <int> a(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
}
int ans = 0;
for(int i = 0; i < n; i++) {
int x = a[i];
while(i < n && x <= a[i]) {
x = a[i];
i++;
}
i--;
ans++;
}
cout << ans << "\n";
return 0;
}
/*
1 5 6
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |