#include "mountains.h"
#include <vector>
int maximum_deevs(std::vector<int> y) {
int n=y.size();
int x=0;
if(y[0]<y[1]){
x++;
}
for(int i=1;i<n-1;i++){
if(y[i-1]>y[i]&& y[i+1]>y[i])x++;
}
if(y[n-1]<y[n-2])x++;
return x;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |