Module Expr Str Assign NameStore Str Import alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpOr UnaryOpNot AttributeLoad NameLoad attr CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr UnaryOpUSub NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareGt BinOpSub NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr UnaryOpUSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse If CompareGt BinOpSub NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr UnaryOpUSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpSub BinOpAdd NameLoad NameLoad Num Num If CompareEq BinOpMod BinOpAdd NameLoad NameLoad Num Num body If CompareEq NameLoad BinOpSub NameLoad Num body Return UnaryOpUSub SubscriptLoad AttributeLoad NameLoad attr Index Num orelse If CompareEq NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index Num Raise Call NameLoad Str orelse Return BinOpDiv BinOpAdd UnaryOpUSub SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list If CompareEq NameLoad Str body Import alias Assign NameStore Call NameLoad Str Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Print NameLoad
N/A N/A 
Problem Statement

The median of a finite list of numbers can be found by arranging all the integers from lowest to highest value and
picking the middle one. For example, the median of {3,3,5,9,11} is 5. If there is an even number of integers, then
there is no single middle value, and the median is then usually defined to be the mean of the two middle values. For
examples, the median of {3,5,7,9} is (5+7)2=6.

Given that integers are read from a data stream, find the median of elements read so far in an efficient way.
 N/A __author__ Daniel N/A heapq DualHeap N/A object N/A __init__ N/A N/A self N/A N/A N/A 
        Dual Heap is great in the case where there is no removal.
        :return:
         N/A N/A self min_h N/A N/A N/A self max_h N/A N/A insert N/A N/A self num N/A N/A N/A N/A N/A N/A self min_h N/A num N/A N/A self min_h N/A 0 N/A N/A N/A N/A heapq heappush N/A self min_h num N/A N/A N/A N/A heapq heappush N/A self max_h N/A num N/A N/A N/A self balance N/A balance N/A N/A self N/A N/A N/A l1 N/A len N/A self min_h N/A l2 N/A len N/A self max_h N/A N/A N/A l1 l2 1 N/A N/A N/A N/A heapq heappush N/A self max_h N/A N/A N/A heapq heappop N/A self min_h N/A N/A N/A self balance N/A N/A N/A N/A l2 l1 1 N/A N/A N/A N/A heapq heappush N/A self min_h N/A N/A N/A heapq heappop N/A self max_h N/A N/A N/A self balance N/A N/A get_median N/A N/A self N/A N/A N/A l1 N/A len N/A self min_h N/A l2 N/A len N/A self max_h N/A m N/A N/A N/A l1 l2 1 2 N/A N/A N/A N/A l1 l2 2 1 N/A N/A N/A m N/A l2 1 N/A N/A N/A N/A N/A self max_h N/A 0 N/A N/A N/A m l2 N/A N/A N/A N/A self min_h N/A 0 N/A N/A Exception not balanced N/A N/A N/A N/A N/A N/A N/A self max_h N/A 0 N/A N/A self min_h N/A 0 2.0 N/A N/A Solution N/A N/A __init__ N/A N/A self N/A N/A N/A N/A self dh N/A DualHeap N/A solve N/A N/A self cipher N/A N/A N/A 
        :param nums: A list of integers.
        :return: The median of numbers
         N/A N/A N/A N/A self dh insert cipher N/A N/A N/A N/A self dh get_median N/A N/A N/A N/A __name__ __main__ N/A N/A sys N/A f N/A open 0.in r N/A solution N/A Solution N/A testcases N/A int N/A N/A N/A N/A f readline strip N/A t N/A xrange testcases N/A N/A cipher N/A int N/A N/A N/A N/A f readline strip N/A s N/A %.1f
 N/A N/A solution solve cipher N/A s