woj1007- Feeding Animals(I)
来源:互联网 发布:网络更新时间 编辑:程序博客网 时间:2024/05/16 11:25
贪心,把每一列最小的加起来。
#include<stdio.h>#include<stdlib.h>#include<string.h> #define INF 10001int main(){ int cas; while((scanf("%d" , &cas)) != EOF) { int a[8][cas]; int i , j; for(i = 0;i < 8;i++) { for(j = 0; j < cas; j++) { scanf("%d",&a[i][j]); } } int min[10001]; memset(min,10001,sizeof(min)); int total = 0; for(j = 0; j < cas; j++) { for(i = 0;i < 8;i++) { min[j] = min[j] < a[i][j] ? min[j] : a[i][j]; } total += min[j]; } printf("%d\n",total); } return 0; }
- woj1007- Feeding Animals(I)
- WOJ1007-Feeding Animals(I)
- WOJ1008-Feeding Animals(II)
- Animals
- feeding time
- ubuntu animals
- D - Animals
- C. Animals
- sicily 2002 Feeding Time
- Sicily 2002. Feeding Time
- Sicily 2002 Feeding Time
- Sicily 2002. Feeding Time
- Guangzhou Welcomes Animals
- woj 1005 Holding Animals
- woj1005 - Holding Animals
- woj1006-Language of Animals
- 1602 - Lattice Animals
- UVa 1602 Lattice Animals
- MyEclipse6.0安装SVN
- java线程的五种状态
- JavaScript学习笔记(二十三) 私有的属性和方法
- 创建一个Windows Phone 应用程序工程
- HDU 1058 Humble Numbers
- woj1007- Feeding Animals(I)
- ARM kernel 2.6.26 下的kgdb调试
- 图论 极大强连通分支
- OD和IDA快捷键
- [并发并行]_[pthread]_[线程池的简单设计与实现]
- Oracle CASE WHEN 用法介绍
- 百度绿萝算法上线公告
- Eclipse
- 雅虎关闭了七项产品业务包括黑莓手机应用