본문 바로가기

SWEA10

[JAVA] 백준 2206 벽 부수고 이동하기 [BFS] 전체 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class baek { static int N, M, MIN = Integer.MAX_VALUE; static char arr[][]; static boolean chk = false; static int dy[] = { 1, -1, 0, 0 }; static int dx[] = { 0, 0, 1, -1 }; static boolean v[][][]; //stati.. 2020. 8. 26.
[JAVA] SWEA 1859 백만 장자 프로젝트 전체 코드 package algorithm; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class SWEA_백반장자프로젝트 { static int T, N, arr[], idx; public static void main(String[] args) { Scanner sc = new Scanner(System.in); T = sc.nextInt(); Queue q; for (int test = 1; test 2020. 8. 25.
[JAVA] SWEA 4615 재미있는 오셀로게임 전체 코드 import java.util.Scanner; public class SWEA_4615_재미없는오셀로게임 { static int T, N, M; public static void main(String[] args) { Scanner sc = new Scanner(System.in); T = sc.nextInt(); int[][] arr; int y, x, col, ry, rx, ry2, rx2, w, b; int[] dy = { -1, -1, +1, +1, 0, 0, 1, -1 }; // int[] dx = { -1, +1, +1, -1, 1, -1, 0, 0 }; for (int test = 1; test = 0 && ry = 0 && rx < N) { // 범위 체크 i.. 2020. 8. 21.
[JAVA] SWEA 4014 활주로 건설 전체 코드 import java.util.Scanner; public class SWEA_4014_활주로건설 { static int N, T, X, CNT; public static void main(String[] args) { Scanner sc = new Scanner(System.in); T = sc.nextInt(); for (int test = 1; test =X){//건설가능 cnt = 1; }else// 건설불가 return; }else if(now == f-1) { //낮아질때, 앞에 설치할 수 있는지 체크해야 하므로 인덱스 추가 if(i + X - 1 < N) { //건설가능, 앞에 길 있는지 체크 for(int j = i; j=X){//건설가능 cnt = 1; }else// 건설불가 .. 2020. 8. 20.