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