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
- 자바
- db
- 클라우드
- 페이징
- feign
- Jenkins
- 쿼리
- 알고리즘
- Spring Cloud
- retry
- 코딩
- PL/SQL
- DP
- golang
- Kafka
- Spring Boot
- 오라클
- 디자인 패턴
- Spring
- Intellj
- 백준
- MST
- aws
- 데이터베이스
- 자료구조
- JPA
- MVC
- Spring Cloud Feign
- SQL
- 운영체제
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 |