ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ์š”๊ฒฉ ์‹œ์Šคํ…œ
ยท
Algorithm/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
https://school.programmers.co.kr/learn/courses/30/lessons/181188 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ๋ฌธ์ œ ๋ฐœ์‚ฌํ•œ ๋ฏธ์‚ฌ์ผ์€ x์ถ•์— ํ‰ํ–‰ํ•œ ์ง์„  ํ˜•ํƒœ์˜ ๋ชจ์–‘์ด๋ฉฐ ์ •์ˆ˜ ์Œ (s, e) ํ˜•ํƒœ๋กœ ํ‘œํ˜„๋จ y ์ถ•์— ์ˆ˜ํ‰์ด ๋˜๋„๋ก ๋ฏธ์‚ฌ์ผ์„ ๋ฐœ์‚ฌํ•˜๋ฉฐ, ๋ฐœ์‚ฌ๋œ ๋ฏธ์‚ฌ์ผ์€ ํ•ด๋‹น x ์ขŒํ‘œ์— ๊ฑธ์ณ์žˆ๋Š” ๋ชจ๋“  ํญ๊ฒฉ ๋ฏธ์‚ฌ์ผ์„ ๊ด€ํ†ตํ•˜์—ฌ ํ•œ ๋ฒˆ์— ์š”๊ฒฉํ•  ์ˆ˜ ์žˆ์Œ ๋‹จ, ๊ฐœ๊ตฌ๊ฐ„ (s, e)๋กœ ํ‘œํ˜„๋˜๋Š” ํญ๊ฒฉ ๋ฏธ์‚ฌ์ผ์€ s์™€ e์—์„œ ๋ฐœ์‚ฌํ•˜๋Š” ์š”๊ฒฉ ๋ฏธ์‚ฌ์ผ๋กœ๋Š” ์š”๊ฒฉํ•  ์ˆ˜ ์—†์Šต ๊ฐ ํญ๊ฒฉ ๋ฏธ์‚ฌ์ผ์˜ x ์ขŒํ‘œ ๋ฒ”์œ„ ๋ชฉ๋ก targets์ด ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ..
SWEA - ์ด์ง„์ˆ˜ ํ‘œํ˜„
ยท
Algorithm/SWEA
๋น„ํŠธ๋งˆ์Šคํ‚น์œผ๋กœ ํ‘ธ๋Š” ๋ฌธ์ œ์ด๋‹ค. ํ’€์ด import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; /* * M์˜ ์ด์ง„์ˆ˜ ํ‘œํ˜„์˜ ๋งˆ์ง€๋ง‰ N๋น„ํŠธ๊ฐ€ ๋ชจ๋‘ 1๋กœ ์ผœ์ ธ ์žˆ๋Š”์ง€ ์•„๋‹Œ์ง€ ํŒ๋ณ„ */ public class Solution { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseI..
SWEA - ์ƒˆ๋กœ์šด ๋ถˆ๋ฉด์ฆ ์น˜๋ฃŒ๋ฒ•
ยท
Algorithm/SWEA
๊ทธ๋ƒฅ ํ’€ ์ˆ˜๋„ ์žˆ์ง€๋งŒ ๋น„ํŠธ๋งˆ์Šคํ‚น์„ ํ™œ์šฉํ•˜์—ฌ ํ’€ ์ˆ˜๋„ ์žˆ๋Š” ๋ฌธ์ œ package algo; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * 1. ์–‘์„ธ๊ธฐ : ์ฒซ ๋ฒˆ์งธ N๋ฒˆ ์–‘, ๋‘ ๋ฒˆ์งธ 2N๋ฒˆ ์–‘ ... k๋ฒˆ์งธ kN๋ฒˆ์–‘ * 2. ํ˜„์žฌ ๋ณธ ์ˆซ์ž : ex) 1295์–‘ -> 1, 2, 9, 5 * 3. 0~9 ๋ชจ๋“  ์ˆซ์ž๋ฅผ ๋ณด๋ฉด ์–‘ ์„ธ๊ธฐ ๋ฉˆ์ถค */ public class swea_์ƒˆ๋กœ์šด๋ถˆ๋ฉด์ฆ์น˜๋ฃŒ๋ฒ• { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br =new Bu..
[Java] Window Eclipse ์ดํด๋ฆฝ์Šค ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •ํ•˜๊ธฐ
ยท
Backend/Java
1. JDK ๋‹ค์šด๋กœ๋“œ & ์„ค์น˜ ์›ํ•˜๋Š” ๋ฒ„์ „์˜ JDK๋ฅผ ์œˆ๋„์šฐ ๋ฒ„์ „์œผ๋กœ ๋‹ค์šดํ•˜๊ณ  ์„ค์น˜ํ•œ๋‹ค. Oracle์ด๋‚˜ Azul์— ๊ฐ€๋ฉด ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค. ์—ฌ๊ธฐ์„œ๋Š” Azul zulu 11๋กœ ์„ ํƒํ•ด ์„ค์น˜ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค. https://www.oracle.com/kr/java/technologies/downloads/ Download the Latest Java LTS Free Subscribe to Java SE and get the most comprehensive Java support available, with 24/7 global access to the experts. www.oracle.com https://www.azul.com/downloads/?package=jdk#zulu Azul Downloads ..
๋ฐฑ์ค€ 9205๋ฒˆ - ๋งฅ์ฃผ ๋งˆ์‹œ๋ฉด์„œ ๊ฑธ์–ด๊ฐ€๊ธฐ
ยท
Algorithm/๋ฐฑ์ค€
https://www.acmicpc.net/problem/9205 9205๋ฒˆ: ๋งฅ์ฃผ ๋งˆ์‹œ๋ฉด์„œ ๊ฑธ์–ด๊ฐ€๊ธฐ ์†ก๋„์— ์‚ฌ๋Š” ์ƒ๊ทผ์ด์™€ ์นœ๊ตฌ๋“ค์€ ์†ก๋„์—์„œ ์—ด๋ฆฌ๋Š” ํŽœํƒ€ํฌํŠธ ๋ฝ ํŽ˜์Šคํ‹ฐ๋ฒŒ์— ๊ฐ€๋ ค๊ณ  ํ•œ๋‹ค. ์˜ฌํ•ด๋Š” ๋งฅ์ฃผ๋ฅผ ๋งˆ์‹œ๋ฉด์„œ ๊ฑธ์–ด๊ฐ€๊ธฐ๋กœ ํ–ˆ๋‹ค. ์ถœ๋ฐœ์€ ์ƒ๊ทผ์ด๋„ค ์ง‘์—์„œ ํ•˜๊ณ , ๋งฅ์ฃผ ํ•œ ๋ฐ•์Šค๋ฅผ ๋“ค๊ณ  ์ถœ๋ฐœํ•œ๋‹ค. www.acmicpc.net ๊ทธ๋ž˜ํ”„ ํƒ์ƒ‰ ๋ฌธ์ œ์ด๋‹ค. ์ฒ˜์Œ์—๋Š” ์ž…๋ ฅ์—์„œ ์ฃผ์–ด์ง„ ์ขŒํ‘œ๋กœ ๊ฐ€๋Šฅํ•œ ๋ฒ”์œ„๋กœ ๊ทธ๋ž˜ํ”„๋ฅผ ๋งŒ๋“ค์–ด์„œ ํƒ์ƒ‰์„ ๋Œ๋ ค์•ผ ํ•˜๋‚˜ ์ƒ๊ฐํ–ˆ์—ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ขŒํ‘œ ์ž์ฒด๋ฅผ ํ•œ ์ •์ ์œผ๋กœ ์ƒ๊ฐํ•˜๊ณ  ์ •์  ๊ฐ„ ํƒ์ƒ‰์„ ํ•ด์ฃผ๋ฉด ๋์—ˆ๋‹ค. 0. ์ž…๋ ฅ๋ฐ›์„ ๋•Œ ํŽธ์˜์ ์˜ ์ขŒํ‘œ๋ฅผ Dot์ด๋ผ๋Š” ๊ฐ์ฒด ๋ฐฐ์—ด์— ์ €์žฅํ•œ๋‹ค. 1. ์ƒ๊ทผ์ด๋„ค ์ง‘์„ ์‹œ์ž‘์œผ๋กœ BFS ํƒ์ƒ‰์„ ํ•œ๋‹ค. 2. ๋ฝํŽ˜์— ๋„์ฐฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌ๋ฅผ ํ•œ๋‹ค.(๋งจํ•˜ํƒ„ ๊ฑฐ๋ฆฌ๊ฐ€ 1000์ดํ•˜์—ฌ์•ผ ํ•œ๋‹ค...
๋ฐฑ์ค€ 1189๋ฒˆ - ์ปด๋ฐฑํ™ˆ
ยท
Algorithm/๋ฐฑ์ค€
https://www.acmicpc.net/problem/1189 1189๋ฒˆ: ์ปด๋ฐฑํ™ˆ ์ฒซ ์ค„์— ์ •์ˆ˜ R(1 ≤ R ≤ 5), C(1 ≤ C ≤ 5), K(1 ≤ K ≤ R×C)๊ฐ€ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„๋˜์–ด ์ฃผ์–ด์ง„๋‹ค. ๋‘ ๋ฒˆ์งธ๋ถ€ํ„ฐ R+1๋ฒˆ์งธ ์ค„๊นŒ์ง€๋Š” R×C ๋งต์˜ ์ •๋ณด๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” '.'๊ณผ 'T'๋กœ ๊ตฌ์„ฑ๋œ ๊ธธ์ด๊ฐ€ C์ธ ๋ฌธ์ž์—ด์ด ์ฃผ์–ด์ง„๋‹ค www.acmicpc.net ์–ด๋Š ํ•œ์ง€์ ์—์„œ ์‹œ์ž‘ํ•ด์„œ ๋‹ค๋ฅธ ์ง€์ ๊นŒ์ง€ ๊ฐˆ ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๋ฐฉ๋ฒ•์„ ํƒ์ƒ‰ํ•ด์•ผ ํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค. ๊ทธ๋ž˜ํ”„ ํƒ์ƒ‰ + ๋ฐฑํŠธ๋ž˜ํ‚น ์œ ํ˜•์˜ ๋ฌธ์ œ์ด๋‹ค. ๋ฐฑํŠธ๋ž˜ํ‚น ๋ฌธ์ œ์—์„œ๋Š” ์žฌ๊ท€๋ฅผ ํ†ตํ•œ DFS ํƒ์ƒ‰์œผ๋กœ ํ‘ธ๋Š” ๊ฒƒ์ด ์ ํ•ฉํ•˜๋‹ค. ๊ทธ๋ž˜์„œ ํ’€๋ฉด์„œ ๊ฐ™์€ ์œ ํ˜•์ธ 1987๋ฒˆ ์•ŒํŒŒ๋ฒณ๊ณผ ๋น„์Šทํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค. https://www.acmicpc.net/problem/1987 1987๋ฒˆ: ์•ŒํŒŒ๋ฒณ ์„ธ๋กœ..
giraffe_
'์ž๋ฐ”' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก (7 Page)