프로그래머스 (10) 썸네일형 리스트형 [PGS] 프로그래머스 - 여행경로 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/43164 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; class Solution { static int[] visited; static PriorityQueue pq; public void dfs(String cityName, String[][] tickets, String path, int node){ if(node==tickets.length){ //다 돌았다 pq.add(path); return; } for(.. [프로그래머스] PGS - 게임 맵 최단거리 https://school.programmers.co.kr/learn/courses/30/lessons/1844# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Solution { static class Point{ int x; int y; Point(int x, int y){ this.x = x; this.y = y; } } static int[] dx = {-1,1,0,0}; static int[] dy = {0,0,-1,1}; static int[][] visited; s.. [PGS] 프로그래머스 - 아이템줍기 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/87694 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Solution { static boolean[][] map; static Queue queue; static boolean[][] visited; static int ans; static int sX, sY, iX, iY; static int[] dx = {-1,1,0,0}; static int[] dy = {0,0,.. [PGS] 프로그래머스 - N개의 최소공배수 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/12953 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 최대공약수, 최소공배수 로직을 알고 있으면 금방 풀 수 있는 문제이다. 두개의 수로 차례대로 최소공배수를 구해나가면 마지막 수가 n개 수의 최소공배수가 된다. import java.util.*; class Solution { public int solution(int[] arr) { int answer = arr[0]; for(int i=1; i [PGS] 프로그래머스 - 입국심사 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/43238 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Solution { public long solution(int n, int[] times) { long answer = Long.MAX_VALUE; Arrays.sort(times); long left = 0; long right = times[times.length-1] * (long)n; while(left [PGS] 프로그래머스 - 다리를 지나는 트럭 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/42583 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Solution { static Queue bridge; static Queue trucks; public int solution(int bridge_length, int weight, int[] truck_weights) { int answer = 0; bridge = new LinkedList(); trucks = .. [PGS] 프로그래머스 - 단어 변환 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/43163 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Info{ String word; int depth; Info(String word, int depth){ this.word = word; this.depth = depth; } } class Solution { static boolean[] visited; static Queue queue; static int ans.. [PGS] 프로그래머스 - 체육복 (JAVA) https://school.programmers.co.kr/learn/courses/30/lessons/42862 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; import java.io.*; class Solution { public int solution(int n, int[] lost, int[] reserve) { int answer = n-lost.length; Arrays.sort(lost); Arrays.sort(reserve); for(int i=0;i 이전 1 2 다음