본문 바로가기

전체 글2991

[프로그래머스/Java] 대충 만든 자판 -Codeimport java.util.*;class Solution { public int[] solution(String[] keymap, String[] targets) { int[] answer = new int[targets.length]; Map map = new HashMap(); for (String key : keymap) { for (int i = 0; i map말고 다른 방식으로 풀다가 틀려서 질문을 보고 map과  getOrDefault를 보고 힌트를 얻어서 해결했습니다. 2025. 3. 7.
[백준/파이썬] 21280번 Förvirrad föreläsare -Coden = int(input())arr = list(map(int, input().split()))now = arr[0]res = [0, 0]for el in arr[1:]: if now > el: res[0] += now - el elif now 2025. 3. 7.
[백준/파이썬] 6436번 Floppies -Codefrom math import ceilt = 0while True: s = int(input()) if s == 0: break t += 1 res = ceil(s / 2) res = ceil(res * 1.5) res = ceil(res / 1860000) print(f"File #{t}") print(f"John needs {res} floppies.") print() 2025. 3. 6.
[백준/파이썬] 20490번 Fermatovi Fakini -Coden = int(input())arr = list(map(int, input().split()))odd, even = [], []for num in arr: if num % 2 == 1: odd.append(num) else: even.append(num)if len(odd) > len(even): odd.sort() for i in range(1, odd[-1] + 3, 2): if i not in odd: print(i) breakelse: even.sort() for i in range(2, even[-1] + 3, 2): if i not in even: .. 2025. 3. 5.
[프로그래머스 / SQL] 건에 부합하는 중고거래 댓글 조회하기 -CodeSELECT TITLE, UGB.BOARD_ID, UGR.REPLY_ID, UGR.WRITER_ID, UGR.CONTENTS, DATE_FORMAT(UGR.CREATED_DATE, '%Y-%m-%d')FROM USED_GOODS_BOARD AS UGB JOIN USED_GOODS_REPLY AS UGR ON UGB.BOARD_ID = UGR.BOARD_IDWHERE UGB.CREATED_DATE LIKE '2022-10%'ORDER BY UGR.CREATED_DATE, UGB.TITLE; 2025. 3. 4.
[프로그래머스 / SQL] 가장 큰 물고기 10마리 구하기 -CodeSELECT ID, LENGTHFROM FISH_INFOORDER BY LENGTH DESC, IDLIMIT 10; 2025. 3. 4.