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
- 자료구조
- 백준
- coding
- DP
- 코딩
- bfs
- 그래프
- 알고리즘
- Computer science
- 오퍼레이팅시스템
- Stack
- 코테
- 너비우선탐색
- 북리뷰
- 스택
- 개발
- 정석학술정보관
- 오에스
- 브루트포스
- 컴공
- vector
- 정석
- 문제풀이
- 구현
- Operating System
- 컴공과
- 컴퓨터공학과
- cs
- OS
- c++
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