코딩테스트

    컨베이어 벨트 위의 로봇 - 20055번

    컨베이어 벨트 위의 로봇 - 20055번

    package com.company; import java.io.*; import java.util.*; public class Main { static int stage, count, N, K, size; static int[][] arr; static ArrayList robots = new ArrayList(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.next..

    도노미노도미노 2 - 20061번

    도노미노도미노 2 - 20061번

    package com.company; import java.io.*; import java.util.*; public class Main { static int count; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; count = 0; ArrayList[] blue = new ArrayList[4]; ArrayList[] green = new ArrayList[4]; for (int i = 0; i < 4; i++) { blue[i] = new ArrayList(..

    미로탈출

    미로탈출

    현재 방 == TRAP 이고 이동할 방 == TRAP 인 경우 현재 방 == TRAP 이고 이동할 방 != TRAP 인 경우 현재 방 != TRAP 이고 이동할 방 == TRAP 인 경우 현재 방 != TRAP 이고 이동할 방 != TRAP 인 경우 크게 네가지로 나눠서 생각했다. 그 다음 각 경우 내부에서 현재 방, 이동할 방 중 TRAP이 2개 또는 0개 인 경우와 1개인 경우 이 두가지로 나눠서 풀이 했다. package com.company; import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new Bu..

    주사위 윷놀이 - 17825번

    주사위 윷놀이 - 17825번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] blue = {{10, 13, 16, 19, 25, 30, 35, 40}, {20, 22, 24, 25, 30, 35, 40}, {30, 28, 27, 26, 25, 30, 35, 40}}; static boolean[] check, checkBlue; static int[][] horse; static int[] move = new int[10]; static int answer = 0; public static void main(String[] args) throws IOException { BufferedReader br = new ..

    원판돌리기 - 17822번

    원판돌리기 - 17822번

    package com.company; import java.io.*; import java.util.*; public class Main { static ArrayList[] list; static int N, M, T; static int[][] d = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.next..

    새로운 게임 2

    새로운 게임 2

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] d = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}}; static int[][] horse, arr; static int N, K, answer; static boolean check; static ArrayList[][] list; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new Stri..

    게리맨더링 2 - 17779번

    게리맨더링 2 - 17779번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] arr, check, startPoint; static boolean[][] visited; static int[][] d = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; static int N, answer; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; answer = Integ..

    연구소 3 -17142번

    연구소 3 -17142번

    package com.company; import java.io.*; import java.util.*; public class Main { static ArrayList virus; static int[][] arr; static int[][] d = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; static int N, M, count, answer; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()..

    미세먼지 안녕! - 17144번

    미세먼지 안녕! - 17144번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] d = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // 시계방향 static int[][] arr; static int R, C, T, refresh, answer; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); R = Inte..

    나무 재테크 - 16235번

    나무 재테크 - 16235번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] d = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}}; static int[][] arr, winter; static int N, M, K; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.re..