当前位置:网站首页>[brush title] goose factory shirt problem
[brush title] goose factory shirt problem
2022-07-05 16:31:00 【m0_ sixty million six hundred and thirty-one thousand three hun】
One 、 subject
Penguin factory activity hair shirt , There are many kinds of t-shirts , Penguins wear T-shirts . In an interview with , Penguins will say how many more penguins wear a T-shirt with him . Some penguins were not interviewed , Put these answers in answers In the array , Return the minimum number of penguins in the activity 
Two 、 Answer key
2.1 Ideas



2.2 Source code
Source code :
public static int minPeople(int[] arr){
int x=arr[0];
int c=1;
int ans=0;
for (int i = 0; i < arr.length; i++) {
if(x!=arr[i]){
ans+=((c+x)/(x+1))*(x+1);
x=arr[i];
c=1;
}else {
c++;
}
}
return ans+((c+x)/(x+1))*(x+1);
}
边栏推荐
- "21 days proficient in typescript-3" - install and build a typescript development environment md
- 【刷题篇】有效的数独
- 10 minutes to help you get ZABBIX monitoring platform alarm pushed to nail group
- sql中set标签的使用
- Relationship between objects and classes
- tf.sequence_mask函数讲解案例
- Win11 prompt: what if the software cannot be downloaded safely? Win11 cannot download software safely
- Use of set tag in SQL
- scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
- 普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理
猜你喜欢

Research and practice of super-resolution technology in the field of real-time audio and video

Research and development efficiency measurement index composition and efficiency measurement methodology
![[deep learning] how does deep learning affect operations research?](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[deep learning] how does deep learning affect operations research?

The visual experience has been comprehensively upgraded, and Howell group and Intel Evo 3.0 have jointly accelerated the reform of the PC industry

Use of set tag in SQL

解决CMakeList find_package找不到Qt5,找不到ECM

scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月

Reduce the cost by 40%! Container practice of redis multi tenant cluster

降本40%!Redis多租户集群的容器化实践

Subclasses and superclasses of abstract classes
随机推荐
数据湖(十四):Spark与Iceberg整合查询操作
ES6深入—ES6 Generator 函数
今日睡眠质量记录79分
Seaborn draws 11 histograms
Pits encountered in the use of boolean type in development
[js] 技巧 简化if 判空
一些認知的思考
Seaborn绘制11个柱状图
ES6深入—async 函数 与 Symbol 类型
Data Lake (XIV): spark and iceberg integrated query operation
【漏洞预警】CVE-2022-26134 Confluence 远程代码执行漏洞POC验证与修复过程
Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
List uses stream flow to add according to the number of certain attributes of the element
The difference between searching forward index and inverted index
Cartoon: what is blue-green deployment?
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
Flet教程之 11 Row组件在水平数组中显示其子项的控件 基础入门(教程含源码)
Cheer yourself up
Flet教程之 09 NavigationRail 基础入门(教程含源码)