Notice
Recent Posts
Recent Comments
Link
Little Jay
[C++] 백준 2417번 - 정수 제곱근 본문
사실 이분 탐색으로 안풀었는데 맞았다.....
이건 맞았는데 13706번은 왜 틀린지 모르겠다
#include <iostream>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long n;
cin >> n;
long long temp = sqrt(n);
if (pow(temp, 2) == n)
cout << temp << '\n';
else
cout << temp + 1 << "\n";
return 0;
}'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 17219번 - 비밀번호 찾기 (0) | 2021.08.16 |
|---|---|
| [C++] 백준 11723번 - 집합 (0) | 2021.08.14 |
| [C++] 백준 13777번 - Hunt The Rabbit (0) | 2021.08.08 |
| [C++] 백준 1654번 - 랜선 자르기(retry needed) (0) | 2021.08.08 |
| [C++] 백준 1453번 - 피시방 알바 (0) | 2021.08.07 |
Comments