algorithm

더블릿|dovelet - 정수 제곱근/boi_squint

블루건 2016. 7. 21. 16:17
문제 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <cmath>
 
using namespace std;
 
int main()
{
    uint64_t n, result;
    cin >> n;
    result = sqrt(n);
    if (pow(result, 2== n || n == 0)
        cout << result;
    else
        cout << result + 1;
 
    return 0;
}
cs