# ---
# title: 493. Reverse Pairs
# id: problem493
# author: Tian Jun
# date: 2020-10-31
# difficulty: Hard
# categories: Binary Search, Divide and Conquer, Sort, Binary Indexed Tree, Segment Tree
# link: <https://leetcode.com/problems/reverse-pairs/description/>
# hidden: true
# ---
# 
# Given an array `nums`, we call `(i, j)` an **_important reverse pair_** if `i
# < j` and `nums[i] > 2*nums[j]`.
# 
# You need to return the number of important reverse pairs in the given array.
# 
# **Example1:**
# 
#     
#     
#     **Input** : [1,3,2,3,1]
#     **Output** : 2
#     
# 
# **Example2:**
# 
#     
#     
#     **Input** : [2,4,3,5,1]
#     **Output** : 3
#     
# 
# **Note:**  
# 
#   1. The length of the given array will not exceed `50,000`.
#   2. All the numbers in the input array are in the range of 32-bit integer.
# 
# 
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end
