코딩테스트
![플로이드 - 11404번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnIR4m%2FbtroPvJYH7I%2FIybOYNxgtOd6p81mLVdpmK%2Fimg.png)
플로이드 - 11404번
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int M, N; static int[][] arr; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readLine()); M = Integer.parseInt(br.readLine()); arr = new int[N + 1][N + 1]; StringTokenizer st = null; for (int i = ..
![쉬운 계단 수 - 10844번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F0AeuQ%2FbtrmYbMdRP4%2FDgpMkOPvT7DYLAQ7aAvBI1%2Fimg.png)
쉬운 계단 수 - 10844번
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readLine()); int[][] arr = new int[101][10]; for (int i = 1; i < 10; i++) { arr[1][i] = 1; } for (int i = 1; i < N; i++) { arr[i + 1][0] = arr..
![최소 힙 - 1927번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbOM1Bb%2FbtrmYD9rUWF%2FCghMyacYEeO2AX03YuXmI1%2Fimg.png)
최소 힙 - 1927번
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N; static PriorityQueue pq = new PriorityQueue(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readLine()); int x = 0; for (int i = 0; i < N; i++) { x = Integer.parseInt(br.readLine()); if (..
![0만들기 - 7490번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FblX4JS%2FbtrmXoSMrgM%2FAxoE8hw5k8gp1lqp1qtxVK%2Fimg.png)
0만들기 - 7490번
풀이 방법 DFS를 이용해서 모두 탐색 후 결과가 0으로 만족되면 list에 저장 list를 정렬 후 출력해줘야함 내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int K, N; static ArrayList list = new ArrayList(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); K = Integer.parseInt(br.readLine()); for (int i = 0; i < K..
![카드 섞기 -21315번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fc3BYTU%2FbtrmLA7ZFyq%2FSHMF7ecwtrSCYGZO4ujd80%2Fimg.png)
카드 섞기 -21315번
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N; static int[] arr; static LinkedList ll = new LinkedList(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readLine()); arr = new int[N]; StringTokenizer st = new StringTokenizer(br.readLine..
![트리 순회](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fxf0gD%2FbtrmQ3ANSLN%2F3XUVpspZKqN0YJS716SYZK%2Fimg.png)
트리 순회
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N; static int[][] arr; static Map map = new HashMap(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; N = Integer.parseInt(br.readLine()); for (int i = 0; i < N; i++) { st = new StringToken..
![신입 사원 - 1946번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcqPZvb%2FbtrmK0ywH5d%2FctqaiufcJSozjrq7pvmVx0%2Fimg.png)
신입 사원 - 1946번
내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int T, N; static int[][] arr; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; T = Integer.parseInt(br.readLine()); for (int i = 0; i < T; i++) { N = Integer.parseInt(br.readLine()); arr = new in..
![암호코드 - 2011번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcUySWt%2FbtrmKiSoeEN%2FbLYIVRKyb5UCJMtKsq9v6K%2Fimg.png)
암호코드 - 2011번
내 코드 package com.company; import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(""); int len = s.length; int[] dp = new int[len + 1]; int[] arr = new int[len + 1]; for (int i = 1; i
![공유기 설치 - 2110번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FL4vQ5%2FbtrmGg1MZCn%2FsprU6iZQGUGr5Dg2NuiITk%2Fimg.png)
공유기 설치 - 2110번
풀이 방법 집의 좌표가 0~1000000000까지라서 이분탐색을 이용해서 풀이해야겠다는 생각이 들었는데 접근하기가 어려웠다. 거리를 이분탐색해서 구했는데 사이 거리의 최솟값과 최댓값을 구해서 그 거리에 맞게 넣어주고 만족하는 최대거리를 찾아주었다. 내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N, C; static ArrayList list = new ArrayList(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamRea..
![램프 - 1034번](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fo2uqC%2FbtrmbWprblm%2FXHBAPKO6baehQWPzlVkbv0%2Fimg.png)
램프 - 1034번
풀이 방법 행의 모든 열이 1인 상태(켜진상태) 인 경우를 세는 것이기 때문에 초기 상태가 같은 경우에는 스위치를 눌러도 변화된 상태가 같기 때문에 Map에 넣어서 갯수를 세어주었다. K가 짝수일 때는 행의 0의 개수가 짝수일 때 모두 1로 바뀔 수 있고 K가 홀수일 때는 행의 0의 개수가 홀수일 때 모두 1로 바뀔 수 있어서 나누어서 생각해주었다. 내 코드 package com.company; import java.io.*; import java.util.*; public class Main { static int N, M, K; static Map map = new HashMap(); public static void main(String[] args) throws IOException { Buffe..