Seize your moment! ๐Ÿ‘พ

์•ˆ๋…•ํ•˜์„ธ์š”. Eric์ž…๋‹ˆ๋‹ค. ์ œ ๋ธ”๋กœ๊ทธ์— ๋ฐฉ๋ฌธํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ’ป ๊ฐœ๋ฐœ๊ณต๋ถ€/Algorithm

[Eric's ๋ฐฑ์ค€] 11727๋ฒˆ - 2 x n ํƒ€์ผ๋ง 2 - Java

Eric_ko 2023. 2. 8. 13:51

์•ˆ๋…•ํ•˜์„ธ์š”! Eric ์ž…๋‹ˆ๋‹ค!

์˜ค๋Š˜ ํ’€์–ด๋ณผ ๋ฌธ์ œ๋Š” ๋ฐฑ์ค€ 11727๋ฒˆ 2 x n ํƒ€์ผ๋ง2 ๋ผ๋Š” ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค!

์–ด์ œ ํ’€์—ˆ๋˜

https://just09.tistory.com/338

 

[Eric's ๋ฐฑ์ค€] 11726๋ฒˆ - 2 x n ํƒ€์ผ๋ง - Java

ํ’€์ด๋ฐฉ๋ฒ• ์ €๋Š” ์–ด๋Š๋•Œ์™€ ๊ฐ™์ด ๊ทธ๋ฆผ์„ ๊ทธ๋ ค์„œ ๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. (์—ฐํ•„๋กœ ๊ทธ๋ฆผ ๊ทธ๋ฆด๋•Œ ์†Œ๋ฆฌ๊ฐ€ ๋„ˆ๋ฌด ์ข‹์•„์š”) ํ•˜๋‹จ์˜ ๊ทธ๋ฆผ์„ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋“ฏ n = 3 ๋ถ€ํ„ฐ๋Š” ํ”ผ๋ณด๋‚˜์น˜์ˆ˜์—ด์„ ๋”ฐ๋ฅด๋Š” ์‚ฌ์‹ค์„ ๊ทธ๋ฆผ

just09.tistory.com

์ด ๋ฌธ์ œ์™€ ๋„ ๋ฌธ์ œ ๋‚ด์šฉ์ด ํก์‚ฌํ•˜์ง€๋งŒ,

11726๋ฒˆ ๋ฌธ์ œ๋ž‘์€ ๋‹ค๋ฅธ์ ์€ ๊ตฌํ˜„ํ•˜๋Š” ๊ทœ์น™ ๋ถ€๋ถ„์ด ๋‹ค๋ฅด๋”๋ผ๊ตฌ์š”!

์ €๋Š” ์˜ค๋Š˜๋„ ๋ฌธ์ œ๋ฅผ ๊ทธ๋ฆผ์„ ๊ทธ๋ ค๊ฐ€๋ฉฐ ํ’€์–ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค!

 

์œ„์˜ ๊ทธ๋ฆผ์„ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋“ฏ

 

ํ•˜๋‚˜์˜ ๊ทœ์น™์„ฑ์ด ๋ณด์ž…๋‹ˆ๋‹ค.

f(n) ์˜ ๊ฐ’์„ ๊ตฌํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋ฉด

f(n) = f(n-1) + 2 * f(n-2)

์˜ ๊ทœ์น™์ด ๋ณด์—ฌ์„œ

๋ฐ”๋กœ ์ฝ”๋“œ๋กœ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

 

์ฝ”๋“œ

 

Solved.ac ํ”„๋กœํ•„