import java.util.*;
public class Solution {
    // 两个堆,一个大堆,一个小堆,大堆存储较小的元素,小堆存储较大的元素!
    PriorityQueue<Integer> min = new PriorityQueue<>();
    PriorityQueue<Integer> max = new PriorityQueue<>((o1,o2)->o2-o1);
    
    public void Insert(Integer num) {
       min.offer(num);
        max.offer(min.poll());
        if(min.size() < max.si***.offer(max.poll());
    }

    public Double GetMedian() {
        if((min.size() + max.size()) % 2 != 0) return min.peek()/1.0;
        return (min.peek() + max.peek())/2.0;
    }
}