当前位置:网站首页>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;
}
};边栏推荐
- Ecmascript6 introduction and environment construction
- notepad++
- Codeforces round 684 (Div. 2) e - green shopping (line segment tree)
- Basic number theory - fast power
- Infix expression evaluation
- asp. Net (c)
- 3D reconstruction open source code summary [keep updated]
- Digital analog 2: integer programming
- Array, date, string object method
- Halcon: check of blob analysis_ Blister capsule detection
猜你喜欢

牛顿迭代法(解非线性方程)

Ros-11 common visualization tools

TF coordinate transformation of common components of ros-9 ROS

IT冷知识(更新ing~)

Programming implementation of ROS learning 2 publisher node

Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
![Rebuild my 3D world [open source] [serialization-1]](/img/74/b6253845b43bc18f425d57695fba7c.jpg)
Rebuild my 3D world [open source] [serialization-1]

Yolov4 target detection backbone

Shift operation of complement

Numpy pit: after the addition of dimension (n, 1) and dimension (n,) array, the dimension becomes (n, n)
随机推荐
Characteristic Engineering
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
C [essential skills] use of configurationmanager class (use of file app.config)
特征工程
Adaboost使用
Beautiful soup parsing and extracting data
kubeadm系列-01-preflight究竟有多少check
Solution to the problem of the 10th Programming Competition (synchronized competition) of Harbin University of technology "Colin Minglun Cup"
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Halcon wood texture recognition
IT冷知识(更新ing~)
[daiy4] copy of JZ35 complex linked list
[formation quotidienne - Tencent Selection 50] 557. Inverser le mot III dans la chaîne
牛顿迭代法(解非线性方程)
迁移学习和域自适应
多元线性回归(梯度下降法)
Pearson correlation coefficient
Mengxin summary of LIS (longest ascending subsequence) topics
C#绘制带控制点的Bezier曲线,用于点阵图像及矢量图形
我从技术到产品经理的几点体会