Problem Solving

Problem Solving

    [백준, 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]; // 형과 동생의 토핑 ..

    [프로그래머스, 64065] 튜플 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/64065 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 111 MB, 시간: 45.90 ms사용 알고리즘: 자료구조, 문자열import java.util.*;class Solution { public int[] solution(String s) { int start, end; StringTokenizer st; ArrayList list; Map map = new HashMap(); for(int i = 1; i ();..

    [프로그래머스, 12949] 행렬의 곱셈 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/12949 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 76.8 MB, 시간: 11.13 ms사용 알고리즘: 배열class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int[][] answer = new int[arr1.length][arr2[0].length]; for(int i = 0; i

    [프로그래머스, 87390] n^2 배열 자르기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/87390 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 111 MB, 시간: 8.38 ms사용 알고리즘: 구현class Solution { public int[] solution(int n, long left, long right) { int[] answer = new int[(int)(right - left) + 1]; long x, y, num; for(long i = left; i

    [프로그래머스, 76502] 괄호 회전하기 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/76502 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 87 MB, 시간: 569.57 ms사용 알고리즘: 스택import java.util.*;class Solution { public int solution(String s) { int answer = 0; List sList = new LinkedList(); for(int i = 0; i stack = new Stack(); boolean flag; ..

    [프로그래머스, 131701] 연속 부분 수열 합의 개수 (java)

    https://school.programmers.co.kr/learn/courses/30/lessons/131701 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 135 MB, 시간: 1471.99 ms사용 알고리즘: 구현import java.util.*;class Solution { public int solution(int[] elements) { // 중복 제거를 위한 맵 Set set = new HashSet(); int sum, idx; for(int i = 1; i

    [백준, BOJ 2166] 다각형의 면적 (java)

    https://www.acmicpc.net/problem/2166메모리: 17,176 KB , 시간: 132 ms사용 알고리즘: 기하학, 다각형의 넓이 기하학의 신발끈 공식이라는 개념이 필요한 문제이다.import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.StringTokenizer;public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; ..