Nghịch thế 2


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 1G

Problem type

Cho dãy $a_1,a_2,...,a_N$. Hãy đếm số lượng cặp $(i,j)$ với $1\le i <j \le N$ và $a_i > a_j$.

Dữ liệu

  • Dòng đầu tiên chứa số nguyên $N \ (1\le N \le 10^5)$;
  • Dòng tiếp theo chứa $N$ số nguyên $a_i \ (1\le a_i \le 10^9)$.

Kết quả

  • Kết quả bài toán.

Ví dụ

Ví dụ 1

input

6
3 10 5 3 1 2

output

11

Comments

There are no comments at the moment.