
Problem Solving
[프로그래머스, 120852] 소인수분해 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/120852 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 79 MB, 시간: 0.62 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int n) { // 소수가 아닌 수 체크 boolean[] isNotPN = new boolean[n + 1]; // n의 소인수를 임시로 담을 리스트 List list = new ArrayList..
[프로그래머스, 120853] 컨트롤 제트 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/120853 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 105 MB, 시간: 1.67 ms사용 알고리즘: 구현import java.util.*;class Solution { public int solution(String s) { StringTokenizer st = new StringTokenizer(s); int answer = 0; int pre = 0; // 이전에 나온 숫자 Strin..
[프로그래머스, 181888] n개 간격의 원소들 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181888 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 72.3 MB, 시간: 0.37 ms사용 알고리즘: 구현class Solution { public int[] solution(int[] num_list, int n) { int[] answer = new int[(int)Math.ceil((double)num_list.length / n)]; int idx = 0; for(int i = 0; i
[프로그래머스, 181889] n 번째 원소까지 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181889 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 87.1 MB, 시간: 0.04 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int[] num_list, int n) { return Arrays.copyOfRange(num_list, 0, n); }}
[프로그래머스, 181891] 순서 바꾸기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181891 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 86.9 MB, 시간: 0.03 ms사용 알고리즘: 구현class Solution { public int[] solution(int[] num_list, int n) { int[] answer = new int[num_list.length]; int idx = 0; for(int i = n; i
[프로그래머스, 181892] n 번째 원소부터 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181892 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 82.5 MB, 시간: 0.04 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int[] num_list, int n) { return Arrays.copyOfRange(num_list, n - 1, num_list.length); }}
[백준, BOJ 1254] 팰린드롬 만들기 (java)
https://www.acmicpc.net/problem/1254메모리: 11,488 KB , 시간: 68 ms사용 알고리즘: 브루트포스 알고리즘, 문자열 import java.io.BufferedReader;import java.io.InputStreamReader;public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String S = br.readLine(); boolean flag; for(int i = 0; i
[프로그래머스, 181895] 배열 만들기 3 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181895 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 105 MB, 시간: 1.67 ms사용 알고리즘: 구현class Solution { public int[] solution(int[] arr, int[][] intervals) { int[] answer = new int[intervals[0][1] - intervals[0][0] + intervals[1][1] - intervals[1][0] + ..
[프로그래머스, 181896] 첫 번째로 나오는 음수 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181896 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 74.3 MB, 시간: 0.08 ms사용 알고리즘: 구현class Solution { public int solution(int[] num_list) { for(int i = 0; i
[프로그래머스, 181897] 리스트 자르기 (java)
https://school.programmers.co.kr/learn/courses/30/lessons/181897 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr메모리: 85.4 MB, 시간: 0.05 ms사용 알고리즘: 구현import java.util.*;class Solution { public int[] solution(int n, int[] slicer, int[] num_list) { int a = slicer[0], b = slicer[1], c = slicer[2]; int[] answer; if(n =..