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 ...
随机推荐
- HDFS 整体把握
对于HDFS这样一个分布式文件系统,它的目的是为了实现在多台廉价X86服务器上实现大文件存储. HDFS 是仿造GFS 设计出来的. 如图所示, 这种实现方案是一种采取有一个中心节点, 多个数 ...
- HDU 5344 MZL's xor (水题)
题意:给一个序列A,设序列B的中的元素有(Ai+Aj)(1≤i,j≤n),那么求B中所有元素的异或之和.而序列A是这样来的:A1=0,Ai=(Ai−1∗m+z) mod l. 思路:相同的元素异或结果 ...
- WebView增加一个水平Progress,位置、长相随意
实际效果可以参看微信的web页面进度条 本质就是通过addView及对WebView 页面进度进行监听 先看看这个自定义的DrawableId,我们参照系统默认实现的方法写一个自己的 <la ...
- 无法加载 DLL“ArcGISVersion.dll”: 找不到指定的模块
无法加载 DLL“ArcGISVersion.dll”: 找不到指定的模块.(异常来自 HRESULT:0x8007007E).
- mybatis注解详解
首 先当然得下载mybatis-3.0.5.jar和mybatis-spring-1.0.1.jar两个JAR包,并放在WEB-INF的lib目录下 (如果你使用maven,则jar会根据你的pom配 ...
- npoi z
http://blog.csdn.net/fireghost57/article/details/25623143 http://www.cnblogs.com/jiagoushi/archive/2 ...
- 【C++】统计代码覆盖率(二)
嗷嗷嗷!!!好激动,我好蠢.不过最后还是解决了.呜呜呜 有些都是东一块西一块查的,如果有侵权欢迎私信我,我注明出处. 一 gcov&CMake 昨天试了下测试代码和被测代码都是c++的情况,直 ...
- XML序列化成对象
这个是和ALM上传测试结果结合使用的//把xml序列化成对象以及把对象序列化成xml using System; using System.Data; using System.Configurati ...
- 《Windows程序设计第5版》学习进度备忘
书签:另外跳过的内容有待跟进 __________________学习资源: <Windows程序设计第5版珍藏版> __________________知识基础支持: _________ ...
- grails下的httpclient
httpclient已经发布到4.3版本了,其中的API发生了巨大的变化,尤其是对于关闭连接显得更加容易理解,比如引入了CloseableHttpResponse. 然而grails2.3.2中自带了 ...