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 |
Tags
- db
- PL/SQL
- 쿼리
- Spring
- 오라클
- feign
- golang
- Spring Boot
- 페이징
- MST
- Spring Cloud
- aws
- MVC
- SQL
- DP
- 알고리즘
- retry
- 자료구조
- Kafka
- Intellj
- JPA
- 자바
- Spring Cloud Feign
- 클라우드
- 운영체제
- 백준
- 데이터베이스
- 디자인 패턴
- 코딩
- Jenkins
Archives
- Today
- Total
justgo_developer
[JAVA] 백준 1057 토너먼트 본문
import java.util.*;
public class Main {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int N = sc.nextInt();
int kim = sc.nextInt();
int lim = sc.nextInt();
int cnt = 0;
while(kim!=lim){
kim = kim/2 + kim%2;
lim = lim/2 + lim%2;
cnt++;
}
System.out.print(cnt);
}
}
'IT > 코딩 문제 풀이' 카테고리의 다른 글
| [JAVA] 백준 1012 유기농배추 (0) | 2018.01.10 |
|---|---|
| [JAVA]백준 2178 미로탐색 (0) | 2018.01.09 |
| [JAVA] 백준 2161 카드1 (0) | 2018.01.03 |
| [JAVA] 백준 1547 공 (0) | 2018.01.03 |
| [JAVA] 백준 2455번 지능형기차 (0) | 2018.01.01 |