当前位置:网站首页>Sword finger offer 14- I. cut rope
Sword finger offer 14- I. cut rope
2022-06-29 01:09:00 【qq_ forty-eight million two hundred and thirty thousand four hu】
I'll give you a length of n The rope of , Please cut the rope to the whole length m paragraph (m、n Are integers. ,n>1 also m>1), The length of each rope is recorded as k[0],k[1]...k[m-1] . Excuse me, k[0]*k[1]*...*k[m-1] What's the maximum possible product ? for example , When the length of the rope is 8 when , We cut it into lengths of 2、3、3 Three paragraphs of , The maximum product we get here is 18.
-------------------------------------------------------------------------------------------------------
Ideas : According to mathematical derivation 3 Is the factor that can achieve the maximum product
n by 1 and 2 The result is 1 1|1*1
n by 3 The result is 2 |1*2
Using a loop On the condition that n》4 So the only thing left 3 2 1 The result is that each cycle is multiplied by 3 n Subtract... From each cycle 3
边栏推荐
- [leetcode] 522. Longest special sequence II violence + double pointer
- 戴口罩人脸数据集和戴口罩人脸生成方法
- QT is based on RFID Management System (applicable to most RFID Management Systems)
- 统计学习方法(2/22)感知机
- Jbridge bridging frame technology for AI computing power landing
- sql入门
- Is it safe and reliable for qiniu school to help open a securities account? How to drive
- [MCU club] design of blind water cup based on MCU [physical design]
- 3D, point cloud splicing
- PR 2021 quick start tutorial, how to use audio editing in PR?
猜你喜欢

Difference between applying for trademark in the name of individual and company
![User login (remember the user) & user registration (verification code) [using cookie session technology]](/img/31/c84c1e15aa1c73814c4ad643e3dd36.png)
User login (remember the user) & user registration (verification code) [using cookie session technology]

Browser cache library design summary (localstorage/indexeddb)

【leetcode】1719. Number of schemes for reconstructing a tree

What is the reason for the service crash caused by replacing the easycvr cluster version with the old database?

After easycvr creates a new user, the video access page cannot be clicked. Fix the problem

分析框架——用户体验度量数据体系搭建

Blazor University (34) forms - get form status

肖特基二极管在防止电源反接的作用

旋轉接頭安裝使用注意事項
随机推荐
【架构师(第三十八篇)】 服务端开发之本地安装最新版 MySQL 数据库
674. longest continuous increasing sequence
Werewolf kill casual game wechat applet template source code / wechat game source code
Misunderstanding of innovation by enterprise and it leaders
【温度检测】基于matlab GUI热红外图像温度检测系统【含Matlab源码 1920期】
[Gym 102423]-Elven Efficiency | 思维
Uvm:factory mechanism
Ensemble de données sur les visages masqués et méthode de génération des visages masqués
How to calculate the income tax of foreign-funded enterprises
[SV basics] some usage of queue
第八天 脚本与音频
[image processing] image curve adjustment system based on MATLAB
Blazor University (34) forms - get form status
Getting started with SQL
用户登录(记住用户)&用户注册(验证码) [运用Cookie Session技术]
[staff] accent mark, gradually stronger mark and gradually weaker mark
[MCU club] design of blind water cup based on MCU [simulation design]
User login (remember the user) & user registration (verification code) [using cookie session technology]
cocoscreator动态切换SkeletonData实现骨骼更新
After easycvr creates a new user, the video access page cannot be clicked. Fix the problem