728x90

🐣 알고리즘 삐약/💻 백준 삐약 98

77 삐약 : 백준 11727| 2 x N 타일링 2 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/11727 package BKD_0x10_DP;import java.util.Scanner;public class BOJ_11727 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] dp = new int[10001]; dp[1]=1; dp[2]=3; for(int i=3;i     저번이랑 비슷한 문제라서 하. 자신감 지금 우주 뚫었다. 이러고 적용 해 봐야지 하고 있었는데...  점화식 진짜 개 거지 같아요 ㅇㅅㅇ어떻게 다들..

76 삐약 : 백준 1003| 피보나치 함수 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/1003 package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class BOJ_1003 { static Integer[][] dp = new Integer[41][2]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.r..

75 삐약 : 백준 11659| 구간 합 구하기 4 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/11659 package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.StringTokenizer;public class BOJ_11659 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st= new StringTokenizer(b..

74 삐약 : 백준 11726| 2xn 타일링 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/11726  package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class BOJ_11726 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] dp = new int[1001];..

73 삐약 : 백준 5279| 계단 오르기 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/2579 package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class BOJ_5279 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] input = new int[n+1]; ..

72 삐약 : 백준 9095| 1,2,3 더하기 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/9095 package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class BOJ_9095 { static int[] dp; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); // test case ..

71 삐약 : 백준 1463| 1로만들기 [바킹독 문제 풀이|DP|JAVA]

https://www.acmicpc.net/problem/1463  package BKD_0x10_DP;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class BOJ_1463 { static Integer[] dp; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); dp ..

70 삐약 : 백준 4179| 불! [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/4179  package BKD_0x9_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 BOJ_4179 { static char[][] building; static Queue person; static Queue fire; static int[] dx={1,-1,0,0}; static int[] dy={0,0,1,-1}; pu..

69 삐약 : 백준 13913| 숨바꼭질4 [바킹독 문제 풀이|BFS|JAVA]

https://www.acmicpc.net/problem/13913  우엑 꽝 기각...중략... q.offer(new Location(N, new StringBuilder().append(N)));...중략... while(!q.isEmpty()){ Location l = q.poll();...중략... ways=l.way.toString(); } } if(l.x+1 초반에는 위치 값과 진행 순서를 문자열로 저장하는 클래스를 선언하여 문제를 풀이하려 했다.그러나 이전에도 겪었듯이 문자열 클래스를 사용하는 것은 메모리상에도 접근하는 시간 상에도 큰 부담을 줄 수 있다는 것을 알고 있기에변동성..

728x90