Programmers/Level3 (44) 썸네일형 리스트형 외벽 점검 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 import java.util.*; class Solution { static ArrayList orders = new ArrayList(); static ArrayList weak_orders = new ArrayList(); static void setOrder(ArrayList.. 야근 지수 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 import java.util.*; class Solution { public long solution(int n, int[] works) { long answer = 0; Arrays.sort(works); int pos = works.length - 1; if(works.length == 1) return works[0] - n 0) { if(pos == works.length - 1) { if(works[pos] >= works[pos - 1]) { works[pos]--; n--; } else pos--; } else { if(.. 합승 택시 요금 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 class Solution { public int solution(int n, int s, int a, int b, int[][] fares) { int answer = 0; int[][] distance = new int[n+1][n+1]; // 거리 초기화 for(int i=1;i N-Queen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 import java.util.*; class Solution { static int cnt = 0; static void DFS(int[] visited, int n, int row) { // n개의 queen을 모두 놓았을 경우 if(row == n) { cnt++; return; } for(int col=0;col 숫자 게임 12345678910111213141516171819import java.util.*;class Solution { public int solution(int[] A, int[] B) { int answer = 0; int pos = 0; Arrays.sort(A); Arrays.sort(B); for(int i=0;i 가장 긴 팰린드롬 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 class Solution { public int solution(String s) { int answer = 1; for (int i = 1; i = 0 && right 기둥과 보 설치 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 import.. 기지국 설치 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 class Solution { public int solution(int n, int[] stations, int w) { int answer = 0; int i = 1, j = 0; while(i 이전 1 2 3 4 5 6 다음