题目1431:Sort
来源:互联网 发布:路由访客网络什么意思 编辑:程序博客网 时间:2024/05/27 21:46
#include <iostream>#include <stdio.h>#include <algorithm>#include <math.h>#include <string>#include <string.h>#include <vector>#include <queue>#include <stack>#include <sstream>#include <climits>using namespace std;//1431int n,m;priority_queue<int> p;int main(){ //freopen("input.txt","r",stdin); while(scanf("%d%d",&n,&m)!=EOF){ while(!p.empty()) p.pop(); while(n--){ int t;scanf("%d",&t); p.push(t); } while(m--){ if(m==0){ printf("%d",p.top()); p.pop(); } else{ printf("%d ",p.top()); p.pop(); } } printf("\n"); } return 0;}/************************************************************** Problem: 1431 User: cust123 Language: C++ Result: Accepted Time:250 ms Memory:7672 kb****************************************************************/
0 0
- 题目1431:Sort 题目11
- 题目1431:Sort
- 题目1431:Sort
- 题目1431:Sort
- 11-题目1431:Sort
- 题目1431:Sort
- 题目1431:Sort
- 九度题目1431:Sort
- 九度 题目1431:Sort
- 九度题目1431:Sort
- 【九度】题目1431:Sort
- 题目1431:Sort(哈希算法)
- 九度-简单题 题目1431:Sort
- 题目11:Sort
- 【九度OJ】题目1431:Sort 解题报告
- LeetCode题目4:Sort List
- LeetCode之Sort题目汇总
- LeetCode算法题目:Sort List
- PCIE之sth_util.cpp
- java 服务器获取请求的IP方法之总结
- Android Okhttp3和Gson框架简单使用
- java中的泛型
- Tomcat服务器配置https双向认证(使用keytool生成证书)
- 题目1431:Sort
- 计算机视觉-人脸渐变
- 设计模式一:策略模式
- Python爬虫抓取携程网机票信息并发邮件通知
- bzoj4540 序列
- 题目1432:叠筐
- 诗一首
- Mysql的安装(linux下)
- Y2K Accounting Bug POJ