Submit solution
Points:
0.08 (partial)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Cho một dãy số ~a_{1}~.. ~a_{N}~. Một nghịch thế là một cặp số ~u~, ~v~ sao cho ~u < v~ và ~a_{u} > a_{v}~. Nhiệm vụ của bạn là đếm số nghịch thế.
Input
- Dòng đầu ghi số nguyên dương ~N~.
- ~N~ dòng sau mỗi dòng ghi một số ~a_{i}~ (~1 \leq i \leq N~).
- ~1 \leq N \leq 60000~
- ~1 \leq a_{i} \leq 60000~
Output
- Ghi trên một dòng số ~M~ duy nhất là số nghịch thế.
Sample Input
3
3
1
2
Sample Output
2
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
Minh lo comment nham loi giai ma k biet delete o dau :v xin phep edit binh luan a