POJ 1666
#include<iostream>
using namespace std;
int main()
{
int num_stu;
int i;
int time=;
do{
time=;
cin>>num_stu;
if(num_stu==)
break;
int * counts=new int[num_stu];
int * count=new int[num_stu];
for(i=;i<num_stu;i++){
cin>>counts[i];
count[i]=counts[i];
} while(++time)
{
for(i=;i<num_stu-;i++)
{
count[i+]=counts[i]/+counts[i+]/;
if(count[i+]%!=)
count[i+]++;
}
count[]=counts[num_stu-]/+counts[]/;
if(count[]%!=)
count[]++;
for(i=;i<num_stu;i++)
counts[i]=count[i];
for(i=;i<num_stu-;i++)
if(counts[i]!=counts[i+])
break;
if(i==num_stu-)
break;
}
cout<<time<<" "<<counts[]<<endl;
delete []counts;
delete []count;
}while(); }
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com
POJ 1666的更多相关文章
- POJ - 1666 Candy Sharing Game
这道题只要英语单词都认得,阅读没有问题,就做得出来. POJ - 1666 Candy Sharing Game Time Limit: 1000MS Memory Limit: 10000KB 64 ...
- POJ 题目分类(转载)
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965 ...
- (转)POJ题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- poj分类
初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. ( ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- POJ题目分类(转)
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- POJ题目(转)
http://www.cnblogs.com/kuangbin/archive/2011/07/29/2120667.html 初期:一.基本算法: (1)枚举. (poj1753,poj29 ...
随机推荐
- mycat1.5~1.6的一个bug
以下语句在mysql单库中执行正常: SELECT * FROM device WHERE devicetype='AMS.Monitoring.XlCloud.QKL8154.XLCloudDevi ...
- 添加远程链接MySQL的权限
mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’; 权限1,权限2,…权限n代表select,ins ...
- 不同浏览器的DNS超时重发机制(一)
一.Chrome浏览器(37.0.2062.124 m) 1.在Win7环境下,DNS超时重发的时间间隔为:2s.2s.2s.2s(在这个时刻重复发2个DNS请求).2s.4s,再经过大约14s左右, ...
- html5离线应用详摘
html5离线应用详摘 在html文件里配置如下: <html manifest=”name.manifest”> 在name.manifest文件里配置如下: CACHE MANIFES ...
- (转)android底部弹出iOS7风格对话选项框(QQ对话框)--第三方开源--IOS_Dialog_Library
本文转载于:http://blog.csdn.net/zhangphil/article/details/44940339 完成这个效果的是使用了 IOS_Dialog_Library 下载地址:ht ...
- apache2: bad user name ${APACHE_RUN_USER} 解决
开工后,发现有个虚拟机的apache没起来,调用apache2 -k start 后,提示如下内容: apache2: bad user name ${APACHE_RUN_USER} apache ...
- 【jquery】 API讲解 内部培训资料
资料在百度云盘 一.jquery API讲解 1.jquery api如何使用 jquery api http://www.hemin.cn/jq/ 2.常用api讲解 选择器: 通过$()获取 ...
- mac安装cocoapods
sudo gem install cocoapods
- phpcms v9 企业黄页加入企业会员提示“请选择企业库类型!”
很多新进站长选择使用了PHPCMS v9内容管理系统,它强大的功能无疑吸引了很多人,尤其是企业黄页功能更是其中的佼佼者,但是官方发布的版本兼容性比较差,出现会员加入企业会员提示“请选择企业库类型!”, ...
- Most People Aren’t.
Most people want to be fit, most people aren't. Most people want to build a successful business, mos ...