본문 바로가기

Algorithm Study71

프로그래머스 Lv3_네트워크_Java https://school.programmers.co.kr/learn/courses/30/lessons/43162?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr class Solution { private int n; private int[][] computers; private boolean[] visited; public int solution(int n, int[][] computers) { this.n = n; this.computers = computers; .. 2024. 6. 23.
프로그래머스 Lv3_정수 삼각형_Java https://school.programmers.co.kr/learn/courses/30/lessons/43105 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr class Solution { public int solution(int[][] triangle) { int[][] dp = new int[triangle.length][triangle.length]; dp[0][0] = triangle[0][0]; for(int i = 1; i  풀이- 삼각형 맨 왼쪽과 맨 오른쪽의 값을 구한다- 우리가 생각해서 구해야 하.. 2024. 6. 23.
프로그래머스 Lv2_ 최댓값과 최솟값 https://school.programmers.co.kr/learn/courses/30/lessons/12939 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr   import java.io.*;import java.util.*;class Solution { public String solution(String s) { StringBuilder sb = new StringBuilder(); String[] arr = s.split(" "); int maxValue = Integer.MIN_VALUE; i.. 2024. 6. 20.
백준 2467_용액_JAVA https://www.acmicpc.net/problem/2467 import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] arr = new int[n]; int firstAnswer = 0; int secondAnswer = 0; int value = Intege.. 2024. 6. 2.
백준 19637_IF문 좀 대신 써줘_JAVA https://www.acmicpc.net/problem/19637 import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); // 칭호의 갯수 3 int m = Integer.parseInt(st... 2024. 5. 30.
백준 1715_카드 정렬하기_JAVA https://www.acmicpc.net/problem/1715 import java.util.*;import java.io.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PriorityQueue queue = new PriorityQueue(); int n = Integer.parseInt(br.readLine()); for (int i = 0; i 1) { long value1 = queue.p.. 2024. 5. 19.
백준 2470_두 용액_JAVA https://www.acmicpc.net/problem/2470 import java.util.*;import java.io.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); long[] arr = new long[n]; for (int .. 2024. 5. 19.
백준 16234_인구 이동_JAVA https://www.acmicpc.net/problem/16234 import java.util.*;import java.io.*;public class Main { static int N, L, R; static int[][] grid; static boolean[][] visited; static int[] dx = {1, -1, 0, 0}; static int[] dy = {0, 0, 1, -1}; static ArrayList arr; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReade.. 2024. 5. 5.