๐Ÿ—๏ธ Algorithm 344

๐ŸŸฉ [๋ฐฑ์ค€] [Java] [Silver3] 14501๋ฒˆ_ํ‡ด์‚ฌ

๋ฌธ์ œ https://www.acmicpc.net/problem/14501 14501๋ฒˆ: ํ‡ด์‚ฌ ์ฒซ์งธ ์ค„์— ๋ฐฑ์ค€์ด๊ฐ€ ์–ป์„ ์ˆ˜ ์žˆ๋Š” ์ตœ๋Œ€ ์ด์ต์„ ์ถœ๋ ฅํ•œ๋‹ค. www.acmicpc.net ํ’€์ด package Baekjoon; import java.io.*; import java.util.*; public class B_14501 { public static void main (String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int[] t = new int[N]; int[] p = new int[N..

โน๏ธ[SW Expert Academy] [D4] [1226] ๋ฏธ๋กœ1

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&problemLevel=4&problemLevel=5&contestProbId=AV14vXUqAGMCFAYD&categoryId=AV14vXUqAGMCFAYD&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=ALL&select-1=5&pageSize=10&pageIndex=2 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด # 1226. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ๊ธฐ๋ณธ] 7์ผ์ฐจ - ๋ฏธ๋กœ1 from ..

โน๏ธ[SW Expert Academy] [Python] [D3] [1244] ์ตœ๋Œ€ ์ƒ๊ธˆ

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&problemLevel=4&problemLevel=5&contestProbId=AV15Khn6AN0CFAYD&categoryId=AV15Khn6AN0CFAYD&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=ALL&select-1=5&pageSize=10&pageIndex=1 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด ์ด ๋ฌธ์ œ๋Š” ๋ฐฑํŠธ๋ž˜ํ‚น ๋ฌธ์ œ์ด๋‹ค. ์™„์ „ํƒ์ƒ‰์œผ๋กœ ํ’€๊ฒŒ๋˜๋ฉด ์‹œ๊ฐ„์ดˆ๊ณผ๊ฐ€ ๋ฐœ์ƒ..

โน๏ธ[SW Expert Academy] [Python] [D4] [1210] Ladder1

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14ABYKADACFAYh SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด # 1210. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ๊ธฐ๋ณธ] 2์ผ์ฐจ - Ladder1 [D4] for _ in range(1, 11): tc = int(input()) graph = [list(map(int, input().split())) for _ in range(100)] visited = [[0]*100 for _ in range(100)] start = graph[99].index(2) x, y = ..

โน๏ธ[SW Expert Academy] [Python] [D4] [1249] ๋ณด๊ธ‰๋กœ

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&problemLevel=4&problemLevel=5&contestProbId=AV15QRX6APsCFAYD&categoryId=AV15QRX6APsCFAYD&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=ALL&select-1=5&pageSize=10&pageIndex=1 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด # 1249. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ์‘์šฉ] 4์ผ์ฐจ - ๋ณด๊ธ‰๋กœ from ..

โน๏ธ[SW Expert Academy] [Python] [D2] [1859] ๋ฐฑ๋งŒ ์žฅ์ž ํ”„๋กœ์ ํŠธ

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=2&problemLevel=3&problemLevel=4&problemLevel=5&contestProbId=AV5LrsUaDxcDFAXc&categoryId=AV5LrsUaDxcDFAXc&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=ALL&select-1=5&pageSize=10&pageIndex=1 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด ์ฒ˜์Œ ๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณธ๋‹ค๋ฉด ์กฐ๊ธˆ ์ƒ๊ฐํ•˜๋Š” ๋ฐฉ..

โน๏ธ[SW Expert Academy] [Python] [D3] [1208] Flatten

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=2&problemLevel=3&problemLevel=4&contestProbId=AV139KOaABgCFAYh&categoryId=AV139KOaABgCFAYh&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=ALL&select-1=4&pageSize=10&pageIndex=1 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด ์ž๊พธ ํ’€์ด๋Š” ํ•˜๊ณ  ์ด์ƒํ•œ ๊ณณ์—์„œ ์˜ค๋ฅ˜๋ฅผ ๋ฒ”ํ•œ๋‹ค. ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ์ฝ”๋“œ๋ฅผ..

โน๏ธ [SW Expert Academy] [Python] [D3] 1206. View

๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV134DPqAA8CFAYh SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ํ’€์ด SWEA์˜ D3 ๋ฌธ์ œ์ด๋‹ค. ๋ฌธ์ œ๋ฅผ ์ œ๋Œ€๋กœ ์ฝ์ง€ ์•Š์•„์„œ ์™ผ์ชฝ 2์นธ๊ณผ ์˜ค๋ฅธ์ชฝ ๋‘์นธ์€ ๋†’์ด๊ฐ€ 0์ธ ๊ฒƒ์„ ๊ฐ„๊ณผํ•˜์˜€๋‹ค. ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋ฌด์กฐ๊ฑด ๋ชจ๋“  ์กฐ๊ฑด์„ ์ •ํ™•ํžˆ ์ฝ๊ณ  ํ•ด๊ฒฐํ•ด์•ผ๊ฒ ๋‹ค. ์™ผ์ชฝ๊ณผ ์˜ค๋ฅธ์ชฝ ๋์˜ ๋†’์ด๊ฐ€ 0์ด๋ฏ€๋กœ ๋ฌธ์ œ์˜ ๋‚œ์ด๋„๊ฐ€ ํ™• ๋‚ฎ์•„์ง„๋‹ค. ๋‹จ์ˆœํžˆ ์ž์‹ ์˜ ์œ„์น˜์—์„œ ์™ผ์ชฝ๊ณผ ์˜ค๋ฅธ์ชฝ 2์นธ ์•ˆ์— ์žˆ๋Š” ๋ชจ๋“  ์นธ ์ค‘์— ๊ฐ€์žฅ ๋†’์€ ์นธ์˜ ๊ฐ’์„ ๋นผ๋ฉด ์กฐ๋ง๊ถŒ์˜ ์„ธ๋Œ€ ์ˆ˜๊ฐ€ ๋‚˜์˜ค๊ฒŒ ๋œ๋‹ค. T = int(i..

โฌ› [Programmers] [Java] [Level2] ์˜ˆ์ƒ ๋Œ€์ง„ํ‘œ

๋ฌธ์ œ https://school.programmers.co.kr/learn/courses/30/lessons/12985?language=java ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ํ’€์ด class Solution { public int solution(int n, int a, int b) { int answer = 0; while(true){ a = a / 2 + a % 2; b = b / 2 + b % 2; answer++; if(a==b) break; } return answer; } }

โฌ› [Programmers] [Java] [Level2] ์ ํ”„์™€ ์ˆœ๊ฐ„์ด๋™

๋ฌธ์ œ https://school.programmers.co.kr/learn/courses/30/lessons/12980?language=java ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ํ’€์ด import java.util.*; public class Solution { public int solution(int n) { int ans = 0; while(n != 0){ if(n % 2 == 0){ n /= 2; } else { n--; ans++; } } return ans; } }