367.有效的完全平方数 典型的二分法 bool isPerfectSquare(int num) { if (num <= 0) return false; long int m = num / 2; int left = 0, right = num; while (left <= right) { m = left + (right - left) / 2; if (m * m == num) return true; else if (m * m < num) left = m+1; else right = m-1; } return false; }