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 |
Tags
- 프로그래머스
- WAS WebServer 차이
- BigDecimal
- 리눅스 777
- 오라클
- 파이썬 주식
- JSON 형식
- beautifulsoup
- JavaScript Obejct Notation
- 리눅스 rwx
- Web Server란
- 빗썸 API 사용
- 변동성 돌파전략
- 리눅스
- JSON특징
- 프로그래머스 소수
- pybithumb
- 즐겨찾기가 가장 많은 식당 정보 출력하기
- 파이썬 가상환경
- 단순 반복 자동화
- WAS란
- 와스 웹서버의 차이
- 프로그래머스 SQL
- spring
- Python
- 트레이딩 봇 만들기
- java
- Web Service Architecture
- 파이썬
- string format
Archives
- Today
- Total
IT 개발자_S
[코딜리티]Frog_jump 본문
반응형
1. 입력 X, Y ,D , D점프값
2. 점프를 몇번해야 X가 Y를 넘을 수 있을까?
3. 수식 정의 Y-X 값을 D로 나눔
4. 소수점을 계산하여 나머지가 있으면 +1, 없으면 그대로 출력
// you can also use imports, for example:
// import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int X, int Y, int D) {
// write your code in Java SE 8
int jump =Math.abs( Y-X );
if(jump%D ==0){
return jump/D;
}else{
return (jump/D) +1;
}
}
}
반응형
'IT > 알고리즘_JAVA' 카테고리의 다른 글
[코딜리티] TapeEquilibrium (0) | 2020.05.10 |
---|---|
[코딜리티]PermMissingElem (0) | 2020.05.10 |
[코딜리티]OddOccurrencesInArray (0) | 2020.05.09 |
[코딜리티]CyclicRotation (0) | 2020.05.09 |
[코딜리티] Binary Gap (0) | 2020.05.09 |
Comments