#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
int cont1=0;
int cont2=0;
int ans1=0;
int ans2 = 0;
cin>>n;
int v[n];
for(int i=0; i<n; i++){
cin>>v[i];
}
for(int i=1; i<n; i++){
for(int j=0; j<i; j++){
if(v[i] > v[j]){
cont1 += 1; }
}
for(int k=n; k>i; k--){
if(v[i] > v[k]){
cont2 +=1;
ans1 = cont1*cont2;}
}
ans2 += ans1;
cont1 =0;
cont2=0;
ans1=0;
}
//cout<<"program compiled, output: "<<ans2;
cout<<ans2;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
1492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
1492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2077 ms |
1492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |