[leetcode]69

This question, I first tested the next c ++ standard math library, ah, did it work !!!
and efficiency can also be, like pow of that question, dead slow


class Solution {
public:
    int mySqrt(int x) {
        return sqrt(x);
    }
};
Runtime: 4 ms, faster than 75.96% of C++ online submissions for Sqrt(x).
Memory Usage: 8.2 MB, less than 98.25% of C++ online submissions for Sqrt(x).

Guess you like

Origin www.cnblogs.com/tailiang/p/11718019.html