题解 | 碰撞的蚂蚁

碰撞的蚂蚁

https://www.nowcoder.com/practice/83073edaa76b4d179ee0366518a58dba

#include <cmath>
class Ants {
public:
    double antsCollision(int n) {
        // write code here
        return 1- 1.0f/pow(2, n-1); 
    }
};

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务