题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5349

 #include<stdio.h>
 int main(){
     int cnt;
     int max;
     int N;
     int ch;
     while(~scanf("%d",&N)){
         cnt = ;
         while(N--){
             scanf("%d",&ch);
             ){
                 scanf("%d",&ch);
                 )
                     max = ch;
                 cnt++;
                 max = ch > max ? ch :max;
                 continue;
             }
             &&cnt!=)
                 cnt--;
             &&cnt!=)
                 printf("%d\n",max);
             &&cnt==)
                 printf("0\n");
         }
     }
 }
     #include<stdio.h>
     #include<cstring>
     #include<set>
     using namespace std;
     int main()
     {
         multiset<int>s;
         int T;
         int n, t;
         while(~scanf("%d",&T)){
             while(T--){
                 scanf("%d",&n);
                 switch(n){
                     :
                         scanf("%d",&t);
                         s.insert(t);
                         break;
                     :
                         if(!s.empty())
                             s.erase(*s.begin());
                         break;
                     :
                         if(s.empty())
                             printf("0\n");
                         else
                             printf("%d\n",*--s.end());
                         break;
                 }
             }
         }
     }

hdoj 5349 MZL's simple problem的更多相关文章

  1. mutiset HDOJ 5349 MZL's simple problem

    题目传送门 /* 这题可以用stl的mutiset容器方便求解,我对这东西不熟悉,TLE了几次,最后用读入外挂水过. 题解有O(n)的做法,还以为我是侥幸过的,后来才知道iterator it写在循环 ...

  2. hdu 5349 MZL's simple problem

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple proble ...

  3. 2015 Multi-University Training Contest 5 hdu 5349 MZL's simple problem

    MZL's simple problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  4. 【HDOJ】4267 A Simple Problem with Integers

    树状数组.Easy. /* 4267 */ #include <iostream> #include <string> #include <map> #includ ...

  5. POJ 3468 A Simple Problem with Integers(线段树 成段增减+区间求和)

    A Simple Problem with Integers [题目链接]A Simple Problem with Integers [题目类型]线段树 成段增减+区间求和 &题解: 线段树 ...

  6. POJ 3468 A Simple Problem with Integers(线段树/区间更新)

    题目链接: 传送门 A Simple Problem with Integers Time Limit: 5000MS     Memory Limit: 131072K Description Yo ...

  7. poj 3468:A Simple Problem with Integers(线段树,区间修改求和)

    A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 58269   ...

  8. ACM: A Simple Problem with Integers 解题报告-线段树

    A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%lld & %l ...

  9. poj3468 A Simple Problem with Integers (线段树区间最大值)

    A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 92127   ...

随机推荐

  1. BZOJ 1106 立方体大作战

    BIT. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm&g ...

  2. BZOJ 1977 次小生成树

    TM终于过了.... #include<iostream> #include<cstdio> #include<cstring> #include<algor ...

  3. 【J2EE性能分析篇】JVM参数对J2EE性能优化的影响

    一切J2EE应用都是基于JVM的,那么对于JVM的设置和监控,成为J2EE应用程序性能分析和性能优化的必然手段.今天Sincky和大家交流该话题.这里以Tomcat环境为例,其它WEB服务器如Jbos ...

  4. 【英语】Bingo口语笔记(71) - shit系列

  5. DBA一天干的活

    一.检查活动状态 通过查询基本视图,确认数据库和实例处于正常运行状态,可以对外提供数据服务. 1.1实例状态 SELECT instance_name,status FROM v$instance; ...

  6. Android 从java字节码告诉你 为什么Handler会造成内存泄露

    很多人面试的时候,都知道Handler 极易造成内存泄露,但是有一些讲不出来为什么,好一点的 会告诉你looper msg 之类的,但是你再往下问 为什么msg持有handler handler为什么 ...

  7. datawindow.net 动态按条件汇总字段值

    string xblx = dw1.GetItemString(row, "c_xblx"); string xbid = dw1.GetItemString(row, " ...

  8. 编译及load mydqli.so文件

    (1)cd /usr/local/php-5.2.17/ext/mysqli(2)输入/usr/local/php/bin/phpize 回车(3)./configure --prefix=/usr/ ...

  9. hdu 2732 Leapin' Lizards(最大流)Mid-Central USA 2005

    废话: 这道题不难,稍微构造一下图就可以套最大流的模板了.但是我还是花了好久才解决.一方面是最近确实非常没状态(托词,其实就是最近特别颓废,整天玩游戏看小说,没法静下心来学习),另一方面是不够细心,输 ...

  10. Android的主要组件

    (一)Activity(活动) 作用:提供可视化用户界面 只能通过setContentView(View)来显示指定组件 View组件是所有UI控件.容器控件的基类,View组件就是android应用 ...