当前位置:网站首页>#yyds干货盘点# 解决名企真题:小招喵跑步
#yyds干货盘点# 解决名企真题:小招喵跑步
2022-07-20 12:25:00 【51CTO】
1.描述:
小招喵喜欢在数轴上跑来跑去,假设它现在站在点n处,它只会3种走法,分别是:1.数轴上向前走一步,即n=n+1 2.数轴上向后走一步,即n=n-1 3.数轴上使劲跳跃到当前点的两倍,即n=2*n现在小招喵在原点,即n=0,它想去点x处,快帮小招喵算算最快的走法需要多少步?
小招喵想去的位置x
小招喵最少需要的步数
输入:
输出:
2.代码实现:
边栏推荐
- Annual weight! Huawei cloud 2021 application construction technology practice collection, 400 pages in seven fields + cloud development classic | Yunxiang library No.02 recommendation (with free downl
- Which one is the most suitable for your business, VPS, dos and ECS?
- [machine learning] dandelion Book 1
- Without the life of speculative stock, the best policy is to give up wisely and decisively
- The drawing principle and application of Bao Jiao Bao Hui Bezier curve
- R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize the violin diagram, set the add parameter, add the mean standard deviation line inside the violin, and set er
- 模块学习(二)——MPU6050
- 租用香港服务器您需要知道的5件事
- [security bulletin] Apache spark shell command injection vulnerability (cve-2022-33891) risk notification
- 【C语言进阶】自定义类型——结构体的位段&&枚举&&联合体
猜你喜欢
多级缓存解决方案
DotNetCore.CAP 笔记
从铸剑到御剑:滴滴工程效能平台建设之路
OCR/STR生僻字数据训练 | PaddleOCR的Fine-tune常见问题汇总(3)
【机器学习】《蒲公英书》1
Technical Analysis | Doris connector combined with Flink CDC to achieve accurate access to MySQL database and table exactly once
Get to know MySQL for the first time
Audio and video learning (VIII) -- RTP protocol
LeetCode - 回文数
Hcip notes day 10
随机推荐
ArcGIS API for flex dynamic point and line drawing
Logic of automatic reasoning 05 -- predicate calculus
Image operation and transformation of machine learning foundation (3)
不妨给“云面试”多些辅导
The drawing principle and application of Bao Jiao Bao Hui Bezier curve
Google Earth engine - merra-2 m2t1nxaer: aerosol daily data set from 1980 to 2022
PX4模块设计之十:PX4启动过程
R语言epiDisplay包的kap函数计算配对列联表的计算一致性的比例以及Kappa统计量的值(总一致性、期望一致性)、使用xtabs函数生成二维列联表、使用wttable参数设置权重表参数为w2
uva11100
PG优化篇--执行计划
租用香港服务器您需要知道的5件事
开源demo| ARCall 小程序开源示例发布
Technical Analysis | Doris connector combined with Flink CDC to achieve accurate access to MySQL database and table exactly once
Redis学习笔记(2)——B站动力节点
面部重建与面部姿态估计 | 误差也就个10来度吧
Ocr/str data training | fine tune FAQ summary of paddleocr (3)
【C语言进阶】自定义类型——结构体的位段&&枚举&&联合体
来面试阿里测试工程师,面试官问我未来3-5年规划,我给面试官画个大饼。
Audio and video learning (VIII) -- RTP protocol
【Redis】常见知识点总结