UVa 11292 Dragon of Loowater
来源:互联网 发布:国税发票打印软件 编辑:程序博客网 时间:2024/06/13 13:53
/*UVa 11292 Dragon of Loowater*/#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>using namespace std;int n,m;int main(){ while(scanf("%d%d",&n,&m) && n!=0 && m!=0){ int i; int a[20050]={0};//龙头直径 int p[20050]={0};//骑士能力 for(i=1;i<=n;i++)scanf("%d",&a[i]); for(i=1;i<=m;i++)scanf("%d",&p[i]); sort(a+1,a+n+1);sort(p+1,p+m+1); int num=1; int sum=0; for(i=1;i<=m;i++){ if(p[i]>=a[num]) { sum+=p[i]; num++; } if(num==n+1)break; } if(i==m+1)printf("Loowater is doomed!\n"); else printf("%d\n",sum); } return 0;}
0 0
- uva --11292 --Dragon of Loowater
- UVa 11292 - Dragon of Loowater
- uva - 11292 - Dragon of Loowater
- UVA 11292 - Dragon of Loowater
- uva 11292 - Dragon of Loowater
- Uva-11292-Dragon of Loowater
- UVA 11292 - Dragon of Loowater
- UVA 11292 Dragon of Loowater
- uva 11292 - Dragon of Loowater
- UVA 11292 - Dragon of Loowater
- UVA 11292 Dragon of Loowater
- UVA 11292 Dragon of Loowater
- UVa 11292 Dragon of Loowater
- UVa 11292 Dragon of Loowater
- UVA 11292 Dragon of Loowater
- uva 11292 Dragon of Loowater
- UVA - 11292 Dragon of Loowater
- UVa 11292 Dragon of Loowater
- iOS --- UIcollectionView设置头尾
- 搭建Embedded Linux kernel环境--在QEMU上运行ARM linux系统
- 给 Android 开发者的 RxJava 详解
- 算法导论习题:10.2-7 in Go语言
- iOS ---UICollectionView简单使用
- UVa 11292 Dragon of Loowater
- mac 下安装wget
- R文件丢失
- NOIP2008普及组题解
- 基于storm的实时数据处理方案
- perl lwp 超时问题
- Android中Application类用法
- Mysql Proxy环境搭建
- 前端学习总结(十四)javascript设计模式