Box of Bricks
Box of Bricks
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 63 Accepted Submission(s) : 20
#include <stdio.h>
#include <stdlib.h> int main()
{
int n,a[],i,sum,sign,j=;
scanf("%d",&n);
while()
{
for(i=,sum=;i<n;i++)
{
scanf("%d",&a[i]);
sum+=a[i];
}
sum/=n;
for(i=,sign=;i<n;i++)
{
if(a[i]>sum)
{
sign+=a[i]-sum;
}
}
printf("Set #%d\nThe minimum number of moves is %d.\n\n",j,sign);
j++;
scanf("%d",&n);
if(n==)
break;
}
return;
}
Box of Bricks的更多相关文章
- HDOJ 1326. Box of Bricks 纯水题
Box of Bricks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- Box of Bricks最小移动砖块数目
Description Little Bob likes playing with his box of bricks. He puts the bricks one upon another and ...
- [POJ1477]Box of Bricks
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 19503 Accepted: 7871 Description Litt ...
- HDOJ(HDU) 2088 Box of Bricks(平均值)
Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one upon ano ...
- HDOJ 1326 Box of Bricks(简单题)
Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one upon ano ...
- 591 - Box of Bricks
Box of Bricks Little Bob likes playing with his box of bricks. He puts the bricks one upon another ...
- HDU 2088 Box of Bricks
http://acm.hdu.edu.cn/showproblem.php?pid=2088 Problem Description Little Bob likes playing with his ...
- HDU 2088 Box of Bricks(脑洞)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2088 Box of Bricks Time Limit: 1000/1000 MS (Java/Oth ...
- zoj 1251 Box of Bricks
Box of Bricks Time Limit: 2 Seconds Memory Limit: 65536 KB Little Bob likes playing with his bo ...
随机推荐
- CodeForces 696C PLEASE
快速幂,费马小定理,逆元. 设$dp[n]$表示$n$次操作之后的概率,那么$dp[n] = \frac{{(1 - dp[n - 1])}}{2}$.$1-dp[n - 1]$表示上一次没有在中间的 ...
- [妙味DOM]第六课:鼠标滚轮和COOKIE
知识点总结: 鼠标滚轮事件 存在兼容性问题: IE/chorme : onmousewheel FF : DOMMouseScroll,必需用在addEventListener下,例如: if (ob ...
- JUnit test case 执行顺序
转自:JUnit中按照顺序执行测试方式 很多情况下,写了一堆的test case,希望某一些test case必须在某个test case之后执行.比如,测试某一个Dao代码,希望添加的case在最前 ...
- 关于Android L软件安装问题的发现
android5.0可能存在的问题: 保留数据刷入导致通知栏无法下拉 按home键不能回到桌面 sdcard无法读取等等 刷了Android L之后,有一部分软件无法正常安装,多表现为 同一家公司开发 ...
- 2.Math对象
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- jQuery实例2
下拉框实例: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UT ...
- Java中的Unsafe
在阅读AtomicInteger的源码时,看到了这个类:sum.msic.Unsafe,之前从没见过.所以花了点时间google了一下. Unsafe的源码:http://www.docjar.com ...
- HDU 2064 汉诺塔III(递归)
题目链接 Problem Description 约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下.由小到大顺序串着由64个圆盘构成的塔.目的是将最左边杆上的盘 ...
- MVC3+EF4.1学习系列(九)-----EF4.1其他的一些技巧的使用
上节通过一系列重构 简单的项目就实现了 不过还有些EF的功能没有讲 这节就通过项目 讲讲EF其他的功能与技巧 一.直接执行SQL语句 通常来讲 EF 不用写SQL语句的 但是 在有些场合 比如对生 ...
- 取URL得值
有这样一个URL:http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e,请写一段JS程序提取URL中的各个GET参数(参 ...