题目链接: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. 10个实用的PHP正则表达式 (转)

    http://www.iteye.com/news/23231 1. 验证E-mail地址 这是一个用于验证电子邮件的正则表达式.但它并不是高效.完美的解决方案.在此不推荐使用. $email = & ...

  2. activiti 学习( 三 ) 之 流程启动者

    在启动一个流程时,我们会有将当前用户启动的流程保存起来,作为流程发起人(启动人.申请人.提交人) 而在保存这个流程启动者信息,api 没有明确规范该怎么存.所以这里我总结下我学到的保存流程启动者信息的 ...

  3. python练习程序(c100经典例11)

    题目: 古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? a=1;b=1 print a,b, for i ...

  4. Struts2配置之Struts.properties

    Struts 2框架有两个核心配置文件,其中struts.xml文件主要负责管理应用中的Action映射,以及该Action包含的Result定义等.除此之 外,Struts 2框架还包含     s ...

  5. jacob如何获取word文档的页码

    ActiveXComponent app = new ActiveXComponent("Word.Application"); //启动word String inFile = ...

  6. php 正则中的"i,m,s,x,e"分别表示什么

    i如果设定此修正符,模式中的字符将同时匹配大小写字母.m当设定了此修正符,“行起始”和“行结束”除了匹配整个字符串开头和结束外,还分别匹配其中的换行符的之后和之前.s如果设定了此修正符,模式中的圆点元 ...

  7. pthread_attr_t 线程属性(一)

    1.    线程属性:             使用pthread_attr_t类型表示,我们需要对此结构体进行初始化,                 初始化后使用,使用后还要进行去除初始化!    ...

  8. myeclipse 10 优化

    一.Myeclipse10修改字体 MyEclipse10是基于Eclipse3.7内核,但在Eclipse的Preferences-〉general-〉 Appearance->Colors ...

  9. HTTP协议的状态码

    对于Web编程人员来说,熟悉了解HTTP协议的状态码是很有必要的,很多时侯可能根据HTTP协议的状态码很快就能定位到错误信息!今天整理了一下所有HTTP状态码. HTTP状态码(HTTP Status ...

  10. selenium python (一) 开发环境搭建

    1.工具下载: python工具共包括三个:python.setuptools.pip ²  python:http://python.org/getit/     python开发环境: ²  se ...