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
- 차이
- 맞출수있었는데...
- 파이서닉
- python
- s3목록
- 공백Trim
- 코테
- 공백null치환
- import from 차이점
- 1000개 이상
- Codility
- 이직 3개월차
- Glue
- docker-compose
- 공백트림
- 데이터카탈로그
- AWS
- 파이써닉
- docker
- 디비설치
- GCP mysql
- 코딩테스트
- airflow설치
- cyclerotation
- Binary_gap
- 답안지표기잘못한느낌...
- Glue의 두 가지 핵심 기능
- docker airflow
- 프로그래머스
- 도커 에어플로
Archives
- Today
- Total
작은하마
[codility] FrogJmp 본문
https://app.codility.com/programmers/lessons/3-time_complexity/frog_jmp/
FrogJmp coding task - Learn to Code - Codility
Count minimal number of jumps from position X to Y.
app.codility.com
처음에 while문으로 했지만 시간복잡도가 0점이 나왔다..
count=0
while True:
x+=d
count+=1
if x>=y:
break
count
그래서 아래것으로 바꾸어 풀어보았다.
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
import math
def solution(X, Y, D):
# write your code in Python 3.6
return math.ceil((Y-X)/D)
'코딩테스트 > Codility' 카테고리의 다른 글
[Codility] PermCheck (0) | 2021.07.29 |
---|---|
[Codility] 짝지어 제거하기 (0) | 2021.07.26 |
[Codility] odd occurrences in array (0) | 2021.07.23 |
[codility]디버깅문제 (0) | 2021.07.22 |
[codility] 합이 같은 수 (0) | 2021.07.22 |
Comments