제곱근이라면 +1한값의 제곱을 반환해주는 문제이다. 아니라면 -1 반환
#include <string> #include <vector> #include <cmath> using namespace std; long long solution(long long n) { long long x = sqrt(n); if (x*x == n) return pow(x+1,2); return -1; }