牛客767752055号
牛客767752055号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客767752055号的博客
全部文章
(共23篇)
题解 | #01背包#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 计算01背包问题的结果 * @param V int整型 背包的体积 * @param n int整型 物品的个...
2023-05-20
0
262
题解 | #立方根#
#include <cmath> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @retu...
2023-05-20
1
266
题解 | #字符串变形#
class Solution { public: string trans(string s, int n) { if (n == 0) return s; string res; for (int i = 0; i...
2023-05-19
0
276
题解 | #反转数字#
class Solution { public: /** * * @param x int整型 * @return int整型 */ int reverse(int x) { if(x==0) { ...
2023-05-19
0
229
题解 | #回文数字#
class Solution { public: /** * * @param x int整型 * @return bool布尔型 */ bool isPalindrome(int x) { int i=x,j=0,k; ...
2023-05-19
0
234
题解 | #翻转单词#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 * @return string字符串 ...
2023-05-19
0
299
题解 | #二进制中1的个数#
class Solution { public: int NumberOf1(int n) { int k=0; unsigned int m; if(n<0) { m=4294967296+n...
2023-05-19
0
225
题解 | #求平方根#
class Solution { public: /** * * @param x int整型 * @return int整型 */ int mysqrt(int x) { if(x==1||x==0) { ...
2023-05-18
0
218
题解 | #二叉树根节点到叶子节点的所有路径和#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2023-03-17
0
259
题解 | #大数乘法#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param s string字符串 第一个整数 * @param t string字符串 第二个整数 ...
2023-03-13
0
227
首页
上一页
1
2
3
下一页
末页