#include<bits/stdc++.h>
using namespace std;
int izq(vector<int> v, int n,int m,int a){
int cont=0;
for(int i=0;i<m;i++){
if(v[i]<a){
for(int j=m+1;j<n;j++){
if(v[j]<a){
cont++;
}
}
}
}
return cont;
}
int main(){
int n,x,cont=0;
cin>>n;
vector<int> v;
v.reserve(n);
for(int i=0;i<n;i++){
cin>>x;
v.push_back(x);
}
for(int i=0;i<n-1;i++){
cont+=izq(v,n,i,v[i]);
}
cout<<cont<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
2078 ms |
2644 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2086 ms |
2616 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2086 ms |
2616 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 |
2086 ms |
2616 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 |
2078 ms |
2644 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |