목록Queue (2)
hara
BEAKJOON JAVA ALGORITHM #1963(소수경로)
https://www.acmicpc.net/problem/1963 import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class a1963 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); boolean[] check = new boolean[10001]; for(int i=2; i
공부/알고리즘
2017. 8. 9. 22:47
BEAKJOON JAVA ALGORITHM #1697(숨바꼭질)
https://www.acmicpc.net/problem/1697 import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class a1697 { public static final int max = 100000; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); int y = sc.nextInt(); boolean[] check = new boolean[max+1]; int[] dist = new int[max+1]; check[s] = true; dist[s] = 0; Queu..
공부/알고리즘
2017. 8. 9. 22:45