天地乖離
天地乖離
全部文章
分类
归档
标签
去牛客网
登录
/
注册
天地乖離的博客
全部文章
(共3篇)
题解 | 碰撞的蚂蚁
class Ants { public: double antsCollision(int n) { // write code here return 1-pow(0.5,n-1); } }; 对于任意一条边上,两端点的蚂蚁不发生碰撞的概率为0.5;...
2025-09-24
0
12
题解 | 整数转化
class Transform { public: int calcCost(int A, int B) { // write code here int ans=0; while(A||B){ ans += (A%2!...
2025-09-24
0
11
题解 | 判断二叉树是否相等
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2025-09-24
0
13