분류 전체보기
[프로그래머스, 17687] [3차] n진수 게임 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/17687 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 98.2 MB, 시간: 45.20 ms사용 알고리즘: 구현 import java.util.*;class Solution { LinkedList list; public String solution(int n, int t, int m, int p) { StringBuilder answer = new StringBuilder(); list = new LinkedList();..
[프로그래머스, 92335] k진수에서 소수 개수 구하기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/92335 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 73.6 MB, 시간: 6.52 ms사용 알고리즘: 구현import java.util.*;class Solution { public int solution(int n, int k) { // n을 k진수로 변환 List toK = change(n, k); // 처음 나오는 0과 마지막에 나오는 0 구하기 int firstZero = -1, lastZero = -1;..
[프로그래머스, 17677] [1차] 뉴스 클러스터링 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/17677 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 79.4 MB, 시간: 1.86 ms사용 알고리즘: 구현import java.util.*;class Solution { public int solution(String str1, String str2) { // str1의 다중집합 Map set1 = new HashMap(); getSet(str1, set1); // str2의 다중집합 Map set2..
[프로그래머스, 284530] 연도 별 평균 미세먼지 농도 조회하기 (mysql)
https://school.programmers.co.kr/learn/courses/30/lessons/284530 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krselect year(ym) as 'YEAR', round(avg(pm_val1), 2) as 'PM10', round(avg(pm_val2), 2) as 'PM2.5'from air_pollutionwhere location2 = '수원'group by 1order by 1;
[프로그래머스, 150369] 택배 배달과 수거하기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/150369 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 83.4 MB, 시간: 20.63 ms사용 알고리즘: 구현class Solution { public long solution(int cap, int n, int[] deliveries, int[] pickups) { long answer = 0; // 가장 뒤에 있는 배달지 int lastDelivery = -1; for(int i = n - 1; i >= 0; i--) { ..
[백준, BOJ 1717] 집합의 표현 (java)
https://www.acmicpc.net/problem/1717메모리: 53,188 KB , 시간: 332 ms사용 알고리즘: 유니온-파인드import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.StringTokenizer;public class Main { static int[] parent; public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; st =..
[백준, BOJ 14425] 문자열 집합 (java)
https://www.acmicpc.net/problem/14425메모리: 38,936 KB , 시간: 288 ms사용 알고리즘: 자료 구조, 문자열, 집합과 맵, 해시를 사용한 집합과 맵, 트리를 사용한 집합과 맵 import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.HashSet;import java.util.StringTokenizer;public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.i..
[프로그래머스, 293261] 물고기 종류 별 대어 찾기 (mysql)
https://school.programmers.co.kr/learn/courses/30/lessons/293261 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krselect fi.id as id, fni.fish_name as fish_name, lengthfrom fish_info as fileft join fish_name_info as fnion fi.fish_type = fni.fish_typewhere (fi.fish_type, length) in ( select fish_type, max(length) from fish_info group by fish_type);
[백준, BOJ 7682] 틱택토 (java)
https://www.acmicpc.net/problem/7682메모리: 11,672 KB , 시간: 68 ms사용 알고리즘: 구현, 많은 조건 분기 import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.LinkedList;public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); LinkedList graphs = new LinkedList(); String inp..
[프로그래머스, 132265] 롤케이크 자르기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/132265 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 119 MB, 시간: 27.84 ms사용 알고리즘: 구현class Solution { public int solution(int[] topping) { int answer = 0; // 형과 동생의 각 토핑 개수 int[] t1 = new int[10_001]; int[] t2 = new int[10_001]; // 형과 동생의 토핑 ..