This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mountains.h"
#include <vector>
using namespace std;
int maximum_deevs(vector<int> y) {
int n=y.size();
int cont=0;
if(n==1||n==2)return 1;
for(int i=0;i<n;i++){
if(i==0){
if(y[i+1]>y[i])cont++;
}
else if(i==n-1){
if(y[i-1]>y[i])cont++;
}
else{
if(y[i-1]>y[i]&&y[i]<y[i+1])cont++;
}
}
if(cont==0)return 1;
else return cont;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |