Tích âm


Submit solution

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

Problem type

Cho N số nguyên $a_1,a_2,...,a_N$. Hãy đếm số cặp phần tử $a_i$ và $a_j$ $(i<j)$ sao cho tích $a_i\times a_j<0$ có trong dãy.

Dữ liệu

  • Dòng duy nhất chứa số nguyên dương $N$ $(1\le N \le 10^3)$;
  • Dòng tiếp theo chứa N số nguyên $a_i$ $(|a_i| \le 10^9)$.

Kết quả

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

Ví dụ

Ví dụ 1

input

5
1 2 3 4 5

output

0

Comments

There are no comments at the moment.