No tags yet

No tag edit access

The problem statement has recently been changed. View the changes.

×
time limit per test: 0.25 sec.

memory limit per test: 4096 KB

memory limit per test: 4096 KB

input: standard

output: standard

output: standard

There are N integers (1<=N<=65537) A1, A2,.. AN (0<=Ai<=10^9). You need to find amount of such pairs (i, j) that 1<=i<j<=N and A[i]>A[j].

The first line of the input contains the number N. The second line contains N numbers A1...AN.

Write amount of such pairs.

Input

5

2 3 1 5 4

2 3 1 5 4

Output

3

Author: | Stanislav Angelyuk |

Resource: | Saratov ST team Spring Contest #1 |

Date: | 18.05.2003 |

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/26/2021 03:07:37 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|