hdoj 5349 MZL's simple problem
题目链接: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的更多相关文章
- mutiset HDOJ 5349 MZL's simple problem
题目传送门 /* 这题可以用stl的mutiset容器方便求解,我对这东西不熟悉,TLE了几次,最后用读入外挂水过. 题解有O(n)的做法,还以为我是侥幸过的,后来才知道iterator it写在循环 ...
- hdu 5349 MZL's simple problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple proble ...
- 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 ...
- 【HDOJ】4267 A Simple Problem with Integers
树状数组.Easy. /* 4267 */ #include <iostream> #include <string> #include <map> #includ ...
- POJ 3468 A Simple Problem with Integers(线段树 成段增减+区间求和)
A Simple Problem with Integers [题目链接]A Simple Problem with Integers [题目类型]线段树 成段增减+区间求和 &题解: 线段树 ...
- POJ 3468 A Simple Problem with Integers(线段树/区间更新)
题目链接: 传送门 A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Description Yo ...
- poj 3468:A Simple Problem with Integers(线段树,区间修改求和)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 58269 ...
- ACM: A Simple Problem with Integers 解题报告-线段树
A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%lld & %l ...
- poj3468 A Simple Problem with Integers (线段树区间最大值)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 92127 ...
随机推荐
- Struts2 的 helloworld
配置步骤: 1.在你的strut2目录下找到例子项目,把它的 lib 下的jar拷贝到你的项目.例如我的:struts-2.3.24\apps\struts2-blank 2.struts-2.3.2 ...
- 查看造成等待事件的具体SQL语句
先查看存在的等待事件:col event for a40col WAIT_CLASS format a20select sid,WAIT_CLASS,event,p1,p2,p3,WAIT_TIME, ...
- [Everyday Mathematic]20150216
设 $A,B,C$ 是同阶方阵, 试证: $$\bex (A-B)C=BA^{-1}\ra C(A-B)=A^{-1}B. \eex$$
- android SharedPreferences
除了SQLite数据库外,SharedPreferences也是一种轻型的数据存储方式,它的本质是基于XML文件存储key-value键值 对数据,通常用来存储一些简单的配置信息.其存储位置在/dat ...
- Oracle中本行记录和上一行记录进行比较lead over 函数处理
遇到问题:多表关联查询,有一个要求是,同一保单号,对应多个投资产品Code.以及投资比例,每一个保单号有一个总的投资金额.要求同一保单号那一行,只有第一个总金额有值,剩下的code对应的总金额置空. ...
- 操作符重载.xml
pre{ line-height:1; color:#1e1e1e; background-color:#d2d2d2; font-size:16px;}.sysFunc{color:#627cf6; ...
- mysql 经典题目
题目1:实现如下效果 CREATE TABLE IF NOT EXISTS tb_amount( `Id` INT NOT NULL AUTO_INCREMENT, `), `), `Amount` ...
- Embedded之memory test
1 main.c #include "led.h" #define BASE_ADDRESS (volatile datum *) 0x10000000 #define NUM_B ...
- linux3.0.4编译LDD中的scull全过程
按照惯例,我是应该先写一些本章的收获的,不过太晚了. 在看完第三章之后开始编译,错误一堆,几乎崩溃,幸亏经过不断的百度,总算解决了问题,我发现 我遇到问题比较多,算是集中七个龙珠了吧,感谢先行的大神们 ...
- QCon2013上海站总结 -- 整体印象和感悟
基本情况: QCon 2013(http://www.qconshanghai.com/)上海站的活动一共为期3天(周五.六和日).活动在上海的光大会展中心举行的. QCon(全球软件开发者大会)是由 ...