<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dynamic Archives - Huahua&#039;s Tech Road</title>
	<atom:link href="https://zxi.mytechroad.com/blog/tag/dynamic/feed/" rel="self" type="application/rss+xml" />
	<link>https://zxi.mytechroad.com/blog/tag/dynamic/</link>
	<description></description>
	<lastBuildDate>Wed, 15 Mar 2017 22:40:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.8</generator>

<image>
	<url>https://zxi.mytechroad.com/blog/wp-content/uploads/2017/09/cropped-photo-32x32.jpg</url>
	<title>dynamic Archives - Huahua&#039;s Tech Road</title>
	<link>https://zxi.mytechroad.com/blog/tag/dynamic/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>[ZOJ] 3612: Median</title>
		<link>https://zxi.mytechroad.com/blog/zoj/zoj-3612-median/</link>
					<comments>https://zxi.mytechroad.com/blog/zoj/zoj-3612-median/#respond</comments>
		
		<dc:creator><![CDATA[zxi]]></dc:creator>
		<pubDate>Mon, 13 Mar 2017 02:51:59 +0000</pubDate>
				<category><![CDATA[ZOJ]]></category>
		<category><![CDATA[binary_search]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[median]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[vector]]></category>
		<guid isPermaLink="false">http://zxi.mytechroad.com/blog/?p=17</guid>

					<description><![CDATA[<p>[crayon-663c5c97cbd70779341039/] &#160;</p>
<p>The post <a rel="nofollow" href="https://zxi.mytechroad.com/blog/zoj/zoj-3612-median/">[ZOJ] 3612: Median</a> appeared first on <a rel="nofollow" href="https://zxi.mytechroad.com/blog">Huahua&#039;s Tech Road</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">// 3934633  2017-03-13 10:48:25 Accepted  3612  C++0x 900 540 xxfflower
#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;unordered_map&gt;
#include &lt;algorithm&gt;
#include &lt;queue&gt;
#include &lt;set&gt;
using namespace std;
typedef long long int64;

int main() {
  int t,n,x;
  char op[20];
  cin&gt;&gt;t;

  while(t--) {
    scanf("%d", &amp;n);
    
    vector&lt;int64&gt; a;

    while(n--) {
      scanf("%s %d", op, &amp;x);
      auto it = lower_bound(a.begin(), a.end(), x);

      if(op[0] == 'r') {
        if(it==a.end() || *it != x) {
          puts("Wrong!");
          continue;
        } else {
          a.erase(it);
          if(a.empty()) {
            puts("Empty!");
            continue;
          }
        }
      } else if(op[0] == 'a') {
        a.insert(it, x);
      }

      if(a.size()%2==1) {
        printf("%lld\n", a[a.size()/2]);
      } else {
        int64 ans = a[a.size()/2-1] + a[a.size()/2];
        if(ans%2==0) 
          printf("%lld\n", ans/2);
        else 
          printf("%.1lf\n", ans/2.0);
      }
    }
  }

  return 0;
}</pre><p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://zxi.mytechroad.com/blog/zoj/zoj-3612-median/">[ZOJ] 3612: Median</a> appeared first on <a rel="nofollow" href="https://zxi.mytechroad.com/blog">Huahua&#039;s Tech Road</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zxi.mytechroad.com/blog/zoj/zoj-3612-median/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
