Java464 [백준/Java] 18271번 Preokret -Codeimport java.io.*;public class BOJ18271 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); // 이전 각 팀의 점수 히스토리가 필요하므로 저장 int[][] scoreHistory = new int[n + 1][2]; int[] teamScore = new int[2]; for (in.. 2026. 1. 19. [백준/Java] 10026번 적록색약 -Codeimport java.io.*;import java.util.ArrayDeque;import java.util.Deque;public class BOJ10026 { static class PosInfo { int row, col; public PosInfo (int row, int col) { this.row = row; this.col = col; } } static boolean[][] visited; public static void main(String[] args) throws IOException { BufferedReader br = new Buf.. 2026. 1. 18. [프로그래머스/Java] 이중우선순위큐 -Codeimport java.util.*;class Solution { public int[] solution(String[] operations) { // 우선 순위 큐로 오름차순과 내림차순 2개 관리 PriorityQueue naturalQueue = new PriorityQueue(); PriorityQueue reverseQueue = new PriorityQueue(Comparator.reverseOrder()); // 명령어 받기 for (String operation : operations) { StringTokenizer st = new StringTokenizer(operation); .. 2026. 1. 18. [백준/Java] 21736번 헌내기는 친구가 필요해 -Codeimport java.io.*;import java.util.*;public class BOJ21736 { static class PosInfo { int row, col; public PosInfo (int row, int col) { this.row = row; this.col = col; } } static boolean[][] visited; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(.. 2026. 1. 18. [프로그래머스/Java] [1차] 캐시 -Codeimport java.util.*;class Solution { public int solution(int cacheSize, String[] cities) { int answer = 0; Deque cache = new ArrayDeque(); for (int i = 0; i cacheSize) { cache.pollFirst(); } } return answer; }}캐시에 포함되면 해당 값을 삭제하고 최신화해야 하는 부분을 빼먹고 풀어서 틀렸었습니다. 2026. 1. 18. [백준/Java] 34200번 장애물 -Codeimport java.io.*;import java.util.*;public class BOJ34200 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int cnt = Integer.parseInt(br.readLine()); // 결과 값과 현재 위치 저장을 위한 변수 int answer = 0, now = 0; StringTokenizer st = new StringTokenizer(br.readLine(.. 2026. 1. 18. 이전 1 ··· 8 9 10 11 12 13 14 ··· 78 다음