知道石头呢
知道石头呢
全部文章
分类
归档
标签
去牛客网
登录
/
注册
知道石头呢的博客
全部文章
(共6篇)
题解 | 另类加法
class UnusualAdd { public: int addAB(int A, int B) { // write code here if(B == 0) return A; return (addAB(A^B,(A&...
2026-01-17
0
16
题解 | 无判断max
class Max { public: int getMax(int a, int b) { // write code here return (((long long)a+b)+((((long long)a-b)^(((long long)a-b)>...
2026-01-17
0
16
题解 | 碰撞的蚂蚁
class Ants { public: double antsCollision(int n) { // 1. 输入合法性判断:n≥1(1只蚂蚁无碰撞,2只及以上有明确概率) if (n < 1 || n > 10000) { ...
2026-01-13
0
16
题解 | 整数转化
class Transform { public: int calcCost(int A, int B) { // write code here int xorrestult = A^B; int count = 0; whi...
2026-01-13
0
14
题解 | 判断二叉树是否相等
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2026-01-11
0
19
题解 | 出现一次的数字
class Solution { public: /** * * @param A int整型一维数组 * @param n int A数组长度 * @return int整型 */ int singleNumber(int* A...
2026-01-10
0
22