favicon Jay Lee DevLog

728x90
300x250
#include <string>
#include <vector>
#include <cmath>

using namespace std;

int solution(int n) {
    int answer = 0;
    int temp = sqrt(n);
    return (temp * temp == n) ? 1 : 2;
}

이번 문제도 난이도가 거의 없다.

sqrt만 쓸줄 알면

그냥 바로 제곱근을 구할 수 있기 때문이다.

728x90
반응형

+ Recent posts

/ /

Contact

📧 dlwjdwls60@naver.com


블로그에 내용이 있으면 해당 글을 보여주며, 없으면 내용이 복사된 채로 ChatGPT로 연결됩니다.