CS/Algorithm

CS/Algorithm

[백준 : 1012] 유기농 배추 - JAVA

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; class Dot{ int x; int y; public Dot(int x, int y) { this.x = x; this.y = y; } } public class Main { static int map[][]; // 2차원 미로 배열 static boolean visit[][]; // 2차원 방문여부 배열 static int n, m, ca; static int[] dx = {-1,0,1,0}; static int[] dy = {0,1,0,-1}; public static void bfs(int x, ..

CS/Algorithm

[백준 : 7576] 토마토 - JAVA

import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; class Dot{ int x, y; public Dot(int x, int y) { this.x = x; this.y = y; } } public class Main { static int map[][]; // 2차원 미로 배열 static int n,m; static int[] dx = {-1,0,1,0}; static int[] dy = {0,1,0,-1}; public static int bfs() { //BFS메소드 Queue q = new LinkedList(); for(int i = 0; i < n; i++) { for(int j = 0; j..

CS/Algorithm

[백준 : 2156] 포도주 시식

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer dp[]; static int arr[]; public static void main(String[] args) throws Exception, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); dp = new Integer[N + 1]; arr = new int[N + 1]; for(int i = 1..

CS/Algorithm

[백준 : 11726] 2 x n 타일링 - JAVA

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer dp[]; public static void main(String[] args) throws Exception, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); dp = new Integer[N + 1]; System.out.println(find(N)); } static int find(int N)..

yujindonut
'CS/Algorithm' 카테고리의 글 목록 (18 Page)