본문 바로가기
반응형

백준알고리즘35

백준 계란으로 계란치기 16987번 JAVA DFS import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_16987_2 { static int N; static int result=Integer.MIN_VALUE; static Egg[] eggs; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st.. 2020. 7. 7.
백준 로또 6603번 JAVA DFS 순환 package algo; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_6603 { static int visited[] ; static int count=0; static int k=1; static int number[]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; .. 2020. 7. 6.
백준 1914 하노이 탑 JAVA import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger;public class BJ_1914 {public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); BigInteger result=new BigInteger("1"); //result에 1저장 if(.. 2020. 6. 29.
백준 11403 경로 찾기 JAVA BFS package algo; 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 BJ_11403 { static int map[][]; static int N; static Queue q = new LinkedList(); public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new Buff.. 2020. 6. 28.
반응형