POJ1477
来源:互联网 发布:java句柄是什么 编辑:程序博客网 时间:2024/05/17 11:36
水题一道,不过和UVA的11300搞混了
#include"stdio.h"#define MAX 100000int a[MAX] = {0};int main(void){int n,m,i,sum,ans,ix = 1;while((scanf("%d",&n)) == 1 && n){sum = 0;ans = 0;for( i = 0 ; i < n ; i ++ ){scanf("%d",a + i);sum += a[i];}m = sum / n;for( i = 0 ; i < n ; i ++ ){if(a[i] < m){ans += (m - a[i]);}}printf("Set #%d\n",ix);printf("The minimum number of moves is %d.\n\n",ans);ix ++;}return 0;}
- poj1477
- poj1477
- POJ1477
- poj1477
- poj1477
- POJ1477
- poj1477
- 北大ACM poj1477
- 1poj1477(贪心)
- poj1477 Box of Bricks
- poj1477 box of bricks
- poj1477(水)
- 12 POJ1477 Box of Bricks
- poj1477 Box of Bricks 贪心大水题
- Android中的style&themes
- 二分查找/二分搜索(binary_search)详解
- js jquery验证银行卡号信息
- Win7 开机优化系列-上篇
- asp.net中绘制大数据量的可交互的图表(2)-.net导出服务
- POJ1477
- Linux Live USB制作工具
- GCD介绍(三): Dispatch Sources
- Android recovery下使用 updater-script自制升级包
- ArcGIS 10.1 for Server 新特性简要介绍(构建云GIS平台的基石)
- QTP中Flex2_Plugins_QuickTestPro插件破解方法
- hdu 2053 Swith Game
- SVN对比VSS,不知这样够了没
- ExtJs 4.*、Guice3、MyBatis3、MySql架构的 弱权限管理框架 五