PS/boj
-
boj)13023 - ABCDEPS/boj 2020. 10. 29. 15:44
import java.util.*; class Edge { int from, to; Edge(int from, int to) { this.from = from; this.to = to; } } public class boj_13023{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); // 사람의 수 int m = sc.nextInt(); // 관계의 수 boolean[][] a = new boolean[n][n]; // 인접행렬 ArrayList[] g = (ArrayList[]) new ArrayList[n]; // 인접리스트 ArrayList edges = new Arra..
-
boj)2206 - 벽 부수고 이동하기PS/boj 2020. 10. 24. 17:17
import java.io.*; import java.util.*; public class boj_2206 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int N, M, nx, ny; static int[][] map; static boolean[][][] v; static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; static Queue q = new LinkedList(); public static void main(String[] args) throws IOException ..
-
boj)2573 - 빙산PS/boj 2020. 10. 24. 12:39
import java.io.*; import java.util.*; public class boj_2573 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int N, M, nx, ny; static int[][][] map; static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; public static void main(String[] args) throws IOException { st = new StringTokenizer(br.readLine()); N = Integer.pa..
-
boj)1629 - 곱셈PS/boj 2020. 10. 23. 14:43
import java.io.*; import java.util.*; public class boj_1629 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; public static void main(String[] args) throws IOException { st = new StringTokenizer(br.readLine()); long A = Long.parseLong(st.nextToken()); long B = Long.parseLong(st.nextToken()); long C = Long.parseLong(st.nextToken()); Syst..
-
boj)2468 - 안전 영역PS/boj 2020. 10. 21. 18:09
import java.io.*; import java.util.*; public class boj_2468 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int N, nx, ny, max; static int[][] map = new int[100][100]; static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; static List list = new ArrayList(); public static void main(String[] args) throws IOException {..
-
boj)10026 - 적록색약PS/boj 2020. 10. 21. 17:07
import java.io.*; import java.util.*; public class boj_10026 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int N, nx, ny, ans1, ans2; static char c; static char[][] map = new char[101][101]; static boolean[][] v = new boolean[101][101]; static Queue q = new LinkedList(); static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; public static vo..
-
boj)7569 - 토마토PS/boj 2020. 10. 19. 14:11
import java.io.*; import java.util.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static Queue q = new LinkedList(); static int row, col, h, nx, ny, nz; static int[][][] map; static boolean[][][] v; static int[] dx = {0, 0, -1, 1, 0, 0}; // 위 아래 상 하 좌 우 static int[] dy = {0, 0, 0, 0, -1, 1}; static int[] dz = {1,..
-
boj)1697 - 숨바꼭질PS/boj 2020. 10. 17. 23:43
import java.io.*; import java.util.*; public class boj_1697 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static boolean[] v = new boolean[100001]; static int[] dx = {-1, 1}; static Queue q = new LinkedList(); public static void main(String[] args) throws IOException { StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextTo..