UVa11292
来源:互联网 发布:cad图纸数据计算 编辑:程序博客网 时间:2024/06/02 00:23
#include <cstdio.h>#include <algorithm>#define max 200001using namespace std;int head[max];int knight[max];int main(int argc, char *argv[]){int n,m;while(scanf("%d%d",&n,&m)==1&&n&&m){for(int i = 0; i <= n; i++)scanf("%d",&head[i]);for(int i = 0; i<=m; i++)scanf("%d%d",&knight[i]);sort(head,head+n);sort(knight,knight+m)int cost = 0;int h = 0;for(int i = 0; i <= m; i++){if(knight[i] >= head[h]){cost += knight[i];if(++h == n)break;}if(h <= n)printf("Loowater is doomed!\n");elseprintf("%d",cost);}}return 0;}
0 0
- UVA11292
- UVa11292
- UVa11292
- uva11292
- uva11292
- UVa11292
- Uva11292
- UVA11292
- UVa11292
- UVA11292
- UVa11292
- UVa11292
- UVA11292杀怪
- uva11292--贪心
- uva11292 Dragon of Loowater
- UVA11292:Dragon of Loowater
- UVa11292 Dragon of Loowater
- uva11292 - Dragon of Loowater
- Pylot 是一款开源的用以测试 Web Service性能和扩展性的工具
- jq相关知识
- 正则表达式一些资料
- 常用牛人主页链接
- JAVA 反射调用方法
- UVa11292
- MFC用户界面多线程实例1
- 史上最全的phpstorm常用配置
- I - The 3n + 1 problem(2.4.2)
- 快速生成指定大小的文件
- Linux下mysql定时备份及恢复
- HDU 1213 How Many Tables
- FastReport单元格合并
- matlab 2014a挂掉 libmwfl