POJ-1477
来源:互联网 发布:国际js舞蹈培训好不好 编辑:程序博客网 时间:2024/05/21 17:56
#include<iostream>#include<vector>using namespace std;int main(int argc, char *argv[]){int stacksNum;vector<int> v(50);int setNum=0;while(cin>>stacksNum, stacksNum!=0){int bricksNum=0;int moveTimes=0;setNum++;for(int i=0;i<stacksNum;i++){cin>>v[i];bricksNum+=v[i];}for(int i=0;i<stacksNum;i++){int move=bricksNum/stacksNum-v[i];if(move>0){moveTimes+=move;}}cout<<"Set #"<<setNum<<endl;cout<<"The minimum number of moves is "<<moveTimes<<".\n"<<endl;}return 0;}
0 0
- poj 1477
- POJ-1477
- POJ 1477
- POJ 1477 还是水!
- POJ 1477(贪心)
- POJ 1477 ( 贪心 )
- POJ 1477 解题报告
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- 找到一个重复元素 - 面试题
- LA3938-Ray, Pass me the dishes!--动态最大连续区间和(线段树+前后缀数和组)
- NBUT 1220 SPY
- C语言
- Android 控件之十一:列表组件 ListView
- POJ-1477
- 安卓学习资料(强大)必看!!!
- android---listview
- C语言
- 浙江大学PAT_乙级_1015. 德才论 (25)
- Java Io 之 编码
- -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable a
- OC语言NSDate和NSFormater
- MySQL的基础命令