Skip to content

服务器托管,北京服务器托管,服务器租用-价格及机房咨询

Menu
  • 首页
  • 关于我们
  • 新闻资讯
  • 数据中心
  • 服务器托管
  • 服务器租用
  • 机房租用
  • 支持中心
  • 解决方案
  • 联系我们
Menu

HDU 5349 MZL’s simple problem(优先队列)

Posted on 2023年5月6日 by hackdl

MZL’s simple problem

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 776    Accepted Submission(s): 375

Problem Description

A simple problem

Problem Description

You have a multiple set,and now there are three kinds of operations:

1 x : add number x to set

2 : delete the minimum number (if the set is empty now,then ignore it)

3 : query the maximum number (if the set is empty now,the answer is 0)

 

Input

N (

N≤106),representing the number of operations.

Next 

N line ,each line contains one or two numbers,describe one operation.

The number in this set is not greater than 

109.

 

Output

For each operation 3,output a line representing the answer.

 

Sample Input

6
1 2
1 3
3
1 3
1 4
3

 

Sample Output

3
4

 

Source

2015 Multi-University Training Contest 5

 

点击打开链接

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3f3f3f3f
#define eps 1e-6

using namespace std;

priority_queue, greater > q;///从小到大排列

int n;
int main()
{
    while(scanf("%d",&n)!=EOF)
    {

        while(!q.empty())
        {
            q.pop();
        }
        int x,y;
        int flag  = 0;
        int maxx;
        for(int i=0;i 0)
                {
                    int tt = q.top();
                    while(!q.empty() && q.top() == tt)
                    {
                        q.pop();
                    }
                }
                if(q.size()  0)
                {
                    printf("%dn",maxx);
                }
                else
                {
                    printf("0n");
                }
            }
        }
    }
    return 0;
}

服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net

Related posts:

  1. 昌平数据中心服务器托管服务:保障稳定性和可靠性
  2. 服务器托管是否存在违法风险?
  3. 山西idc机房租用
  4. 高效稳定的服务器托管CDN服务
  5. 自贡云服务器托管服务介绍

服务器托管,北京服务器托管,服务器租用,机房机柜带宽租用

服务器托管

咨询:董先生

电话13051898268 QQ/微信93663045!

上一篇: HDU 5360 Hiking(优先队列)
下一篇: 华为Java机试题

最新更新

  • R语言用多元ARMA,GARCH ,EWMA, ETS,随机波动率SV模型对金融时间序列数据建模|附代码数据
  • mosn基于延迟负载均衡算法 — 走得更快,期待走得更稳 | 京东云技术团队
  • C++之虚函数原理 虚函数表
  • etcd:增加30%的写入性能
  • 为什么要安装虚拟机–Linux系统,我的虚拟机安装过程记录—14版本虚拟机

随机推荐

  • 高效可靠的七台河服务器托管服务
  • 佳木斯服务器托管价格
  • forEach和map的异同
  • 武汉服务器托管公司排名
  • 创梦网络电信高防大带宽服务器

客服咨询

  • 董先生
  • 微信/QQ:93663045
  • 电话:13051898268
  • 邮箱:dongli@hhisp.com
  • 地址:北京市石景山区重聚园甲18号2层

友情链接

  • 服务器托管
  • 服务器租用
  • 机房租用托管
  • 服务器租用托管
©2023 服务器托管,北京服务器托管,服务器租用-价格及机房咨询 京ICP备13047091号-8