Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Operating System
- 알고리즘
- OS
- 오에스
- vector
- 정석
- 스택
- bfs
- 그래프
- 자료구조
- 컴공과
- 오퍼레이팅시스템
- 구현
- 너비우선탐색
- 코딩
- cs
- 정석학술정보관
- 북리뷰
- Computer science
- coding
- c++
- 백준
- 컴공
- 문제풀이
- 코테
- 개발
- DP
- Stack
- 브루트포스
- 컴퓨터공학과
Archives
- Today
- Total
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