Problem Solving/Programmers

    [프로그래머스, 214289] 에어컨 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/214289# 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 130 MB, 시간: 139.39 ms사용 알고리즘: 다이나믹 프로그래밍 n - 1분에서 에어컨을 끄거나, 희망 온도를 올리거나 내리거나, 희망 온도를 유지했을 때 나올 수 있는 모든 경우를 구하여 n분에서 발생할 수 있는 모든 경우를 구하는 방식으로 풀었다.import java.util.*;class Solution { static int temp; static int ..

    [프로그래머스, 214288] 상담원 인원 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/214288?language=java 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr메모리: 75.6 MB, 시간: 3.49 ms사용 알고리즘: 그리디 알고리즘 모든 상담에 대해 멘토를 1명부터 (n - k + 1)명까지 배치했을 때의 대기 시간을 구한다.그 다음 어떤 상담의 멘토를 1명 늘려줄 때, 대기 시간을 가장 줄일 수 있을지 구해서 그 상담의 멘토를 1명 늘려주는 작업을 (n - k)번 진행한다.import java.util.*;class Solut..

    [프로그래머스, 133026] 성분으로 구분한 아이스크림 총 주문량 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/133026 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.krSELECT ingredient_type, SUM(total_order) AS TOTAL_ORDERFROM first_half as fhLEFT JOIN icecream_info as ii ON fh.flavor = ii.flavorGROUP BY ingredient_typeORDER BY TOTAL_ORDER

    [프로그래머스, 59044] 오랜 기간 보호한 동물(1) (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/59044 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.krSELECT name, datetimeFROM animal_insWHERE animal_id NOT IN ( SELECT animal_id FROM animal_outs)ORDER BY datetime LIMIT 3;

    [프로그래머스, 59043] 있었는데요 없었습니다 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/59043 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.krSELECT ins.animal_id, ins.nameFROM animal_ins as ins, animal_outs as outsWHERE ins.animal_id = outs.animal_id AND ins.datetime > outs.datetimeORDER BY ins.datetime

    [프로그래머스, 273709] 조건에 맞는 아이템들의 가격의 총합 구하기 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/273709 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.krSELECT SUM(price) as total_priceFROM item_infoWHERE rarity = 'LEGEND'

    [프로그래머스, 144854] 조건에 맞는 도서와 저자 리스트 출력하기 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/144854 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr SELECT b.book_id, a.author_name, date_format(published_date, '%Y-%m-%d') as published_date FROM book as b LEFT JOIN author as a ON b.author_id = a.author_id WHERE category = '경제' ORDER BY published_date

    [프로그래머스, 131533] 상품 별 오프라인 매출 구하기 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/131533 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr SELECT product_code, sum(sales_amount * price) as sales FROM offline_sale as os left join product as p on os.product_id = p.product_id GROUP BY product_code ORDER BY sales desc, product_code

    [프로그래머스, 144855] 별 도서 판매량 집계하기 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/144855 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr SELECT category, SUM(sales) as total_sales FROM book INNER JOIN book_sales ON book.book_id = book_sales.book_id WHERE sales_date LIKE '2022-01%' GROUP BY category ORDER BY category

    [프로그래머스, 151137] 자동차 종류 별 특정 옵션이 포함된 자동차 수 구하기 (mysql)

    https://school.programmers.co.kr/learn/courses/30/lessons/151137 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr SELECT car_type, COUNT(car_id) as cars FROM car_rental_company_car WHERE options like '%통풍시트%' OR options like '%열선시트%' OR options like '%가죽시트%' GROUP BY car_type ORDER BY car_type