题目链接: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. BPMN2新规范与Activiti5

    上世纪九十年代以后,随着WfMC联盟的成立,BPM市场群雄逐鹿如火如荼,工作流技术得到了突飞猛进的发展,其中IBM.Oracle等大型软件厂商在工作流领域各扯大旗割据一方.2011年BPMN2.0新规 ...

  2. python练习程序(c100经典例18)

    题目: 求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字.例如2+22+222+2222+22222(此时共有5个数相加),几个数相加有键盘控制. def foo(a,n): su ...

  3. #1406 - Data too long for column (转)

    转自:(http://blog.sina.com.cn/s/blog_5115a74c01008e40.html) ERROR (): Data too long for column 解决方法 修改 ...

  4. 【Python】类和对象、继承、使用文件、存储、异常、标准库(不懂)

    当你调用这个对象的方法MyObject.method(arg1, arg2)的时候,这会由Python自动转为MyClass.method(MyObject, arg1, arg2)——这就是self ...

  5. .CO域名快被这帮搞IT的玩坏了……

    鉴于近来国内访问Google的服务受阻,greatfire.org于前天推出了其基于亚马逊AWS的Google搜索镜像网站,地址是sinaapp.co.该网站随后因多家海外媒体的报道和众多微博大V的转 ...

  6. POJ 1306 Combinations

    // 求 C[n][m] // 组合公式 C[i][j]=C[i-1][j-1]+C[i-1][j]; #include <iostream> #include <string> ...

  7. POJ 2249 Binomial Showdown

    // n 个 数 取 k个数的取法// C(n,k) 注意些细节#include <iostream> #include <string> #include<sstrea ...

  8. JS面向对象组件(六) -- 拖拽功能以及组件的延展

    HTML部分 <div id="div1"></div> <div id="div2"></div> CSS部分 ...

  9. tar 实现增量备份

    使用 tar -g 参数进行增量备份实验 完整备份: #执行完整备份tar -g snapshot -zcf back.tar.gz back #查看 tarball 内容[huzi@mail ~]$ ...

  10. ADO.NET+Access: 3,参数 @departmentName 没有默认值

    ylbtech-Error-ADO.NET+Access: 3,参数 @departmentName 没有默认值. 1.A,错误代码返回顶部  3,参数 @departmentName 没有默认值. ...