题目链接: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 4004 装备购买

    md有毒卡什么精度!!!! 最大线性无关组(线性基)可作为模板. #include<iostream> #include<cstdio> #include<cstring ...

  2. 08day2

    引爆炸弹 贪心 [问题描述] 有 n 个炸弹,有些炸弹牵了一根单向引线(也就是说引线只有在这一端能被炸弹点燃),只要引爆了这个炸弹,用引线连接的下一个炸弹也会爆炸.每个炸弹还有个得分,当这个炸弹被引爆 ...

  3. dede 5.7进后台卡死解决办法

    注释后台文件dede/templets/index_body.htm(大概在第18行) <script type="text/javascript"> function ...

  4. 【英语】Bingo口语笔记(6) - 表示“迷茫”

  5. hbase+hive应用场景

    一.Hive应用场景本文主要讲述使用 Hive 的实践,业务不是关键,简要介绍业务场景,本次的任务是对搜索日志数据进行统计分析.集团搜索刚上线不久,日志量并不大 .这些日志分布在 5 台前端机,按小时 ...

  6. 如何脱离SDK,使用DW5.5和phonegap以及JQMobile搭建开发环境

    也许有些人是学C++出身,对于Java几乎不了解.一时心血来潮想学学android开发,于是下载了Eclipse,安装了SDK,有模有样的学习起来.也许是懒惰了,对于java一直总是提不起精神.于是确 ...

  7. hdu 1527(威佐夫博奕)

    题意:容易理解. 分析:威佐夫博奕的模板题. 代码实现: #include<stdio.h> #include<string.h> #include<math.h> ...

  8. Maps

    Maps.uniqueIndex()将列表转换为map  //iterator各个元素作为Map.values, key为Function.apply返回值 Maps.uniqueIndex(ps.i ...

  9. Delphi 串口使用校验位

    平时都用的8N1的模式,这次使用了校验位,因此串口的初始化工作需要改变 #ifdef RT_USING_UART2 USART_InitStructure.USART_BaudRate = 9600; ...

  10. Loadrunner中与事务相关的概念及函数

    一.事务 事务是指用户在客户端做一种或多种业务所需要的操作集,通过事务函数可以标记完成该业务所需要的操作内容:另一方面可以用来统计用户操作的相应时间.事务响应时间是指通过记录用户请求的开始时间和服务器 ...