본문 바로가기

전체 글127

[백준] Gold IV. N-Queen https://www.acmicpc.net/problem/9663 사용 알고리즘백트래킹풀이import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.*;public class Main { static int n; static int [] arr; static int count = 0; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); n = .. 2024. 5. 12.
[백준] Silver.1 연산자 끼워넣기 https://www.acmicpc.net/problem/14888 사용 알고리즘백트래킹재귀풀이import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.*;public class Main { static int n; static int [] nums; static int [] cal = new int [4]; static int max = Integer.MIN_VALUE; static int min = Integer.MAX_VALUE; public static void main(String[] args) throws IOException {.. 2024. 5. 9.
[프로그래머스] Lv.2 요격 시스템 https://school.programmers.co.kr/learn/courses/30/lessons/181188 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 사용 알고리즘그리디 알고리즘정렬풀이import java.util.*;class Solution { public int solution(int[][] targets) { int answer = 0; Arrays.sort(targets, (a,b) -> a[1] - b[1]); int before = 0; for(int [] targ.. 2024. 5. 7.
[백준] Gold 4 카드 정렬하기 https://www.acmicpc.net/problem/1715 사용 알고리즘우선순위 큐 풀이import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;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()); // 10만 , 제한시간 2초 .. 2024. 5. 7.