- ๋ก๋ ๊ตฌ์ ๊ธ์ก์ ์ ๋ ฅํ๋ฉด ๊ตฌ์ ๊ธ์ก์ ํด๋นํ๋ ๋ก๋๋ฅผ ๋ฐ๊ธํด์ผ ํ๋ค.
- ๋ก๋ 1์ฅ์ ๊ฐ๊ฒฉ์ 1000์์ด๋ค.
๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.
14000
14๊ฐ๋ฅผ ๊ตฌ๋งคํ์ต๋๋ค.
[8, 21, 23, 41, 42, 43]
[3, 5, 11, 16, 32, 38]
[7, 11, 16, 35, 36, 44]
[1, 8, 11, 31, 41, 42]
[13, 14, 16, 38, 42, 45]
[7, 11, 30, 40, 42, 43]
[2, 13, 22, 32, 38, 45]
[23, 25, 33, 36, 39, 41]
[1, 3, 5, 14, 22, 45]
[5, 9, 38, 41, 43, 44]
[2, 8, 9, 18, 19, 21]
[13, 14, 18, 21, 23, 35]
[17, 21, 29, 37, 42, 45]
[3, 8, 27, 30, 35, 44]
์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.
1, 2, 3, 4, 5, 6
๋ณด๋์ค ๋ณผ์ ์
๋ ฅํด ์ฃผ์ธ์.
7
๋น์ฒจ ํต๊ณ
---------
3๊ฐ ์ผ์น (5000์)- 1๊ฐ
4๊ฐ ์ผ์น (50000์)- 0๊ฐ
5๊ฐ ์ผ์น (1500000์)- 0๊ฐ
5๊ฐ ์ผ์น, ๋ณด๋์ค ๋ณผ ์ผ์น(30000000์) - 0๊ฐ
6๊ฐ ์ผ์น (2000000000์)- 0๊ฐ
์ด ์์ต๋ฅ ์ 0.35์
๋๋ค.(๊ธฐ์ค์ด 1์ด๊ธฐ ๋๋ฌธ์ ๊ฒฐ๊ณผ์ ์ผ๋ก ์ํด๋ผ๋ ์๋ฏธ์)
- indent(์ธ๋ดํธ, ๋ค์ฌ์ฐ๊ธฐ) depth๋ฅผ 2๋จ๊ณ์์ 1๋จ๊ณ๋ก ์ค์ฌ๋ผ.
- depth์ ๊ฒฝ์ฐ if๋ฌธ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ 1๋จ๊ณ์ depth๊ฐ ์ฆ๊ฐํ๋ค. if๋ฌธ ์์ while๋ฌธ์ ์ฌ์ฉํ๋ค๋ฉด depth๊ฐ 2๋จ๊ณ๊ฐ ๋๋ค.
- else๋ฅผ ์ฌ์ฉํ์ง ๋ง๋ผ.
- ๋ฉ์๋์ ํฌ๊ธฐ๊ฐ ์ต๋ 10๋ผ์ธ์ ๋์ง ์๋๋ก ๊ตฌํํ๋ค.
- method๊ฐ ํ ๊ฐ์ง ์ผ๋ง ํ๋๋ก ์ต๋ํ ์๊ฒ ๋ง๋ค์ด๋ผ.
- ๋ฐฐ์ด ๋์ ArrayList๋ฅผ ์ฌ์ฉํ๋ค.
- java enum์ ์ ์ฉํด ํ๋ก๊ทธ๋๋ฐ์ ๊ตฌํํ๋ค.
- ๊ท์น 3: ๋ชจ๋ ์์๊ฐ๊ณผ ๋ฌธ์์ด์ ํฌ์ฅํ๋ค.
- ๊ท์น 5: ์ค์ฌ์ฐ์ง ์๋๋ค(์ถ์ฝ ๊ธ์ง).
- ๊ท์น 8: ์ผ๊ธ ์ฝ๋ ์ ์ ์ด๋ค.
- ๋ก๋ ์๋ ์์ฑ์ Collections.shuffle() ๋ฉ์๋ ํ์ฉํ๋ค.
- Collections.sort() ๋ฉ์๋๋ฅผ ํ์ฉํด ์ ๋ ฌ ๊ฐ๋ฅํ๋ค.
- ArrayList์ contains() ๋ฉ์๋๋ฅผ ํ์ฉํ๋ฉด ์ด๋ค ๊ฐ์ด ์กด์ฌํ๋์ง ์ ๋ฌด๋ฅผ ํ๋จํ ์ ์๋ค.