题目链接: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. 设置sudo不输入密码 sudoers 编辑出错后的补救方法

    一 设置sudo为不需要密码 有时候我们只需要执行一条root权限的命令也要su到root,是不是有些不方便?这时可以用sudo代替.默认新建的用户不在sudo组,需要编辑/etc/sudoers文件 ...

  2. Cmockery macro demo hacking

    /********************************************************************* * Cmockery macro demo hacking ...

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

    题目: 打印楼梯,同时在楼梯上方打印两个笑脸. print '..' for i in range(1,9): print '**' for j in range(1,i+1): print ' ',

  4. Less的学习(一)

    1.html部分 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head& ...

  5. hdu 1023(java实现进度计算)

    题意:就是问你火车出战的方案数. 分析:卡特兰数的模板题,递推公式:a[n]=a[n-1]*(4*n-2)/(n+1). java代码实现: import java.util.*; import ja ...

  6. propertyGrid控件 z

    1.如果属性是enum类型,那么自然就是下拉的. 2.如果是你自定义的下拉数据,那么需要用到转换属性标签TypeConverter 参见: http://blog.csdn.net/luyifeini ...

  7. U盘安装CentOS无法进入Centos系统解决办法

    转自:http://blog.sina.com.cn/s/blog_3feedf320101idlu.html     目前使用U盘安装系统逐渐因为它的便捷而受到人们的欢迎,但是使用U盘来安装Cent ...

  8. Android百度地图开发(五)公交线路详情搜索、多条线路显示

    一.公交线路详情检索 获取公交线路的详情主要分来两步,1.获取公交线路的Uid,2.通过Uid获取公交线路详情. 1.获取公交线路的Uid: /* * 获得公交线路图的Uid,并且根据系Uid发起公交 ...

  9. matlab 调用VLfeat库开篇问题

    准备工作见此网站 :http://cnyubin.com/?p=85 保存关闭startup.m文件后 重新打开matlab后 在命令行输入path或者vl_version无法检测到库已安装到matl ...

  10. 镜头覆盖范围FOV 的规划与FOV去四角

    本文纲要: 规划FOV的原因 FOV去四角 简单的声明 FOV查找思路 查找FOV的代码 TNoFourCornersRect结构及Contains函数 判断两个矩形是否相交 延伸与拓展 本文内容: ...