#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, i, cont=0, a, b, j;
cin >> n;
ll xd[n];
for(i=0;i<n;i++) {
cin >> xd[i];
}
for(i=1;i<n-1;i++) {
a=0;
b=0;
for(j=0;j<i;j++) {
if(xd[j]<xd[i]) a++;
}
for(j=i+1;j<n;j++) {
if(xd[j]<xd[i]) b++;
}
cont+=a*b;
}
cout << cont << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
2083 ms |
2644 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2081 ms |
2516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2081 ms |
2516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
2 ms |
212 KB |
Output is correct |
4 |
Correct |
2 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
2 ms |
212 KB |
Output is correct |
4 |
Correct |
2 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
332 ms |
340 KB |
Output is correct |
12 |
Correct |
343 ms |
348 KB |
Output is correct |
13 |
Correct |
345 ms |
348 KB |
Output is correct |
14 |
Correct |
328 ms |
356 KB |
Output is correct |
15 |
Correct |
328 ms |
348 KB |
Output is correct |
16 |
Correct |
319 ms |
352 KB |
Output is correct |
17 |
Correct |
336 ms |
348 KB |
Output is correct |
18 |
Correct |
347 ms |
348 KB |
Output is correct |
19 |
Correct |
358 ms |
356 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2081 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 |
2083 ms |
2644 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |