#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 |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
2062 ms |
2516 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
2516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
2516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
212 KB |
Output is correct |
2 |
Correct |
42 ms |
212 KB |
Output is correct |
3 |
Correct |
42 ms |
272 KB |
Output is correct |
4 |
Correct |
42 ms |
276 KB |
Output is correct |
5 |
Correct |
46 ms |
272 KB |
Output is correct |
6 |
Correct |
44 ms |
212 KB |
Output is correct |
7 |
Correct |
43 ms |
212 KB |
Output is correct |
8 |
Correct |
43 ms |
280 KB |
Output is correct |
9 |
Correct |
43 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
212 KB |
Output is correct |
2 |
Correct |
42 ms |
212 KB |
Output is correct |
3 |
Correct |
42 ms |
272 KB |
Output is correct |
4 |
Correct |
42 ms |
276 KB |
Output is correct |
5 |
Correct |
46 ms |
272 KB |
Output is correct |
6 |
Correct |
44 ms |
212 KB |
Output is correct |
7 |
Correct |
43 ms |
212 KB |
Output is correct |
8 |
Correct |
43 ms |
280 KB |
Output is correct |
9 |
Correct |
43 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Execution timed out |
2067 ms |
340 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
2516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
2062 ms |
2516 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |