spoj 16254. Running Median Again | RMID2

i’m in the grey area for 2 days, unable to figure out what is wrong about the algo. the algo is to maintain two priority queues(with different orders) of equal sizes or a +1 diff. and print the median. but i got fixated on sizes and forgot about rearranging the elements.

https://gist.github.com/d993ed60a7f2e0a5c8d9

Advertisements

2 thoughts on “spoj 16254. Running Median Again | RMID2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s