当前位置:网站首页>2310. 个位数字为 K 的整数之和
2310. 个位数字为 K 的整数之和
2022-07-05 08:57:00 【紫菜(Nori)】
参考:
class Solution {
public:
int minimumNumbers(int num, int k) {
// 空多重集的和为 0
if(num == 0){
return 0;
}
// 参考官方题解
for(int i = 1; i <= 10; i++){
if(i * k <= num && (num - (i * k)) % 10 == 0){
return i;
}
}
return -1;
}
};
边栏推荐
- Programming implementation of ROS learning 2 publisher node
- 多元线性回归(梯度下降法)
- [code practice] [stereo matching series] Classic ad census: (4) cross domain cost aggregation
- 编辑器-vi、vim的使用
- location search 属性获取登录用户名
- Halcon blob analysis (ball.hdev)
- asp.net(c#)的货币格式化
- Illustrated network: what is gateway load balancing protocol GLBP?
- [daily training -- Tencent selected 50] 557 Reverse word III in string
- C#【必备技能篇】ConfigurationManager 类的使用(文件App.config的使用)
猜你喜欢
Halcon: check of blob analysis_ Blister capsule detection
Hello everyone, welcome to my CSDN blog!
Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
微信H5公众号获取openid爬坑记
Mathematical modeling: factor analysis
Ros-10 roslaunch summary
生成对抗网络
Summary and Reflection on issues related to seq2seq, attention and transformer in hands-on deep learning
Halcon affine transformations to regions
Programming implementation of subscriber node of ROS learning 3 subscriber
随机推荐
[beauty of algebra] solution method of linear equations ax=0
Attention is all you need
Yolov4 target detection backbone
Halcon clolor_ pieces. Hedv: classifier_ Color recognition
Programming implementation of ROS learning 5-client node
Luo Gu p3177 tree coloring [deeply understand the cycle sequence of knapsack on tree]
[daily training -- Tencent selected 50] 557 Reverse word III in string
Codeforces round 684 (Div. 2) e - green shopping (line segment tree)
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Codeforces Round #648 (Div. 2) D. Solve The Maze
MPSoC QSPI Flash 升级办法
12、动态链接库,dll
C#图像差异对比:图像相减(指针法、高速)
Rebuild my 3D world [open source] [serialization-2]
Oracle advanced (III) detailed explanation of data dictionary
Codeworks round 681 (Div. 2) supplement
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
[daiy4] copy of JZ35 complex linked list
2011-11-21 training record personal training (III)