Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- ubuntu
- 데이콘
- SW Expert Academy
- 백준
- hackerrank
- Docker
- Kaggle
- leetcode
- Real or Not? NLP with Disaster Tweets
- 편스토랑 우승상품
- 자연어처리
- 캐치카페
- 맥북
- 편스토랑
- 금융문자분석경진대회
- ChatGPT
- Baekjoon
- AI 경진대회
- 파이썬
- programmers
- 우분투
- github
- 프로그래머스
- PYTHON
- 코로나19
- 더현대서울 맛집
- 프로그래머스 파이썬
- Git
- dacon
- gs25
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 13706번 : 제곱근 (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 제곱근 입니다.
13706번: 제곱근
첫째 줄에 양의 정수 N이 주어진다. 정수 N의 제곱근은 항상 정수이며, N의 길이는 800자리를 넘지 않는다.
www.acmicpc.net
👨🏻💻 문제 풀이
math의 sqrt로 문제를 풀게되면 런타임 에러 (OverflowError) 가 발생합니다.
from math import isqrt
이때 python3.8 버전부터 새로 생긴 isqrt를 대신 사용하면 해결됩니다.
👨🏻💻 코드 ( Solution )
from math import isqrt
def jegopgun(N):
return isqrt(N)
if __name__ == "__main__":
N = int(input())
print(jegopgun(N))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[leetCode] 2057. Smallest Index With Equal Value (Python) (0) | 2022.02.01 |
---|---|
[leetCode] 1961. Check If String Is a Prefix of Array (Python) (0) | 2022.01.31 |
[BaekJoon] 2163번 : 초콜릿 자르기 (Python) (0) | 2022.01.29 |
[leetCode] 2000. Reverse Prefix of Word (Python) (0) | 2022.01.28 |
[leetCode] 1945. Sum of Digits of String After Convert (Python) (0) | 2022.01.27 |