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 <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
long n;
cin>>n;
long heigh[n];
for(long i=0; i<n; i++){
cin>>heigh[i];
}
long cont=0;
for(long i=0; i<n-2; i++){
for(long j=i+1; j<n-1; j++){
for(long k=j+1; k<n; k++){
//cout<<heigh[i]<<" "<<heigh[j]<<" "<<heigh[k]<<"\n";
if(heigh[i]<heigh[j] and heigh[k]<heigh[j]){
cont++;
}
}
}
}
cout<<cont<<"\n";
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |