๐ ์ฝ๋ฉํ ์คํธ/๐SWEA2 2817. ๋ถ๋ถ ์์ด์ ํฉ (D3 python) ๐ ๋ฌธ์ ๋ฐ๋ก๊ฐ๊ธฐ https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW ํ๋ก๊ทธ๋๋ฐ ์ญ๋ ๊ฐํ์ ๋์์ด ๋๋ ๋ค์ํ ํ์ต ์ปจํ ์ธ ๋ฅผ ํ์ธํ์ธ์! swexpertacademy.com ๐ก์ ๊ทผ ๋ฐฉ๋ฒ ๊ฐ์ ํฌํจํ๋ ๊ฒฝ์ฐ, ํฌํจํ์ง ์๋ ๊ฒฝ์ฐ -> 2๊ฐ์ง์ ๊ฒฝ์ฐ์ ์๋ก ๊ฐ๋๊ฐ ๋๋๊ณ , ๊ทธ ๊ฐ๋ ์ค์ K๊ฐ๊ณผ ๊ฐ์ ๊ฐฏ์๋ฅผ ๊ตฌํ๊ธฐ ์ฌ๋ฌ ๊ฐ๋๋ก ๋ป์ด๋๊ฐ๋ค -> dfs๋ก ์ ๊ทผ ํด๋ณด์! ํฌํจํ๋ ๊ฒฝ์ฐ, ํฌํจํ์ง ์๋ ๊ฒฝ์ฐ -> dfs ์ฌ๊ทํจ์๋ฅผ 2๋ฒ ํธ์ถํด์ ํ๋๋ ํฌํจO, ํ๋๋ ํฌํจX sum์ ์ ๋ฌํ๋ฉด์ sum==K์ด๋ฉด count +=1 ํ๊ณ , return ๐ค return ์ ์ํ๋ฉด? return์ ์ ํ๋ฉด ๊ทธ ๊ฐ๋๊ฐ ๋๋์ง ์.. 2023. 11. 18. 1206. [S/W ๋ฌธ์ ํด๊ฒฐ ๊ธฐ๋ณธ] 1์ผ์ฐจ - View (Python) https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW ํ๋ก๊ทธ๋๋ฐ ์ญ๋ ๊ฐํ์ ๋์์ด ๋๋ ๋ค์ํ ํ์ต ์ปจํ ์ธ ๋ฅผ ํ์ธํ์ธ์! swexpertacademy.com ์ฝ๋ input์ ๊ณต๋ฐฑ์ ๊ธฐ์ค์ผ๋ก ์๋ฅธ๋ค (split) ์ฒ์๊ณผ ๋์ 2๊ฐ๋ 0์ด๋ฏ๋ก 0,1,2 ์ธ ์ธ๋ฒ์งธ๋ถํฐ ์์, ๋์์ -2๊น์ง ์งํ j์์ ์์ 2๊ฐ, ๋ค์ 2๊ฐ ์ค max๋ฅผ ์ฐพ๋๋ค 1,2,5,3,4 ๋ผ๊ณ ํ๋ค๋ฉด j๋ 5์ด๊ณ , ์๋ค 2์นธ์ฉ ๊ณต๋ฐฑ์ด ์๋ ์นธ์ ๊ฐฏ์๋ฅผ ์ธ๋ ๊ฒ์ด๋๊น 3์ ๋ค์ 4์ ๋งํ๋ค 5 - max > 0 ์ธ์ง ๊ฒ์ฌํ ํ 0๋ณด๋ค ํฌ๋ค๋ฉด totalCount์ +๋ฅผ ํ๋ค for tc in range(10): listSize = int(.. 2023. 11. 16. ์ด์ 1 ๋ค์