poj1477
来源:互联网 发布:淘宝版本过低怎么升级 编辑:程序博客网 时间:2024/05/17 14:27
#include<iostream>#include<fstream>using namespace std;int main(){ //ifstream cin("1.txt"); int setnum=1; int n; while(cin>>n&&n!=0){ int a[n]; int sum=0; for(int i=0;i<n;++i){ cin>>a[i]; sum+=a[i]; } int avr=sum/n; int minnum=0; for(int i=0;i<n;++i){ if(a[i]>avr) minnum+=a[i]-avr; } cout<<"Set #"<<setnum++<<endl; cout<<"The minimum number of moves is "<<minnum<<"."<<endl<<endl; } return 0;}
0 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 贪心大水题
- [递归&&bfs]PAT1020 Tree Traversals
- Android图像处理之Bitmap类
- Request.QueryString["**"]发生“未将对象引用设置到对象的实例。”的解决方法
- 多线程主线程接受返回结果
- 腾讯京东合作
- poj1477
- 黑马程序员:初识socket编程(一)
- Qt编写activex所遇到的问题
- 使用Markdown写文档
- Yt初试锋芒--题与分析
- 理解接口开发中的*Ptr
- 方法节点的使用
- 2.23学习心得 Matlab graythresh函数 形态学开闭操作,腐蚀膨胀的作用
- virtualBox启动虚拟机报“The VirtualBox kernel driver is not accessible to the current user”错误