Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
๐ ๋ฌธ์ ๋งํฌ
https://www.acmicpc.net/problem/1654
โ๏ธ ์์๋ ์๊ฐ
45min
โจ ์๋ ์ฝ๋
์ต์๊ธธ์ด๊ฐ 1cm, ์ต๋๊ธธ์ด๋ ๋์ ๋ค ์ค ๊ฐ์ฅ ๊ธด ๋์ ์ด๋ฏ๋ก ๋จผ์ ์๋ฅผ์ ์๋ ๋ฒ์๋ฅผ ์ค์ ํด์ค๋ค.
์ดํ ์ค๊ฐ๊ฐ์ ๊ธฐ์ค์ผ๋ก ๋ชจ๋ ๋์ ์ ์๋ฅธ ํ ๋ง๋ค ์ ์๋ ๋์ ์ ๊ฐ์๋ฅผ ๊ฐ์ฐํ๋ค.
N๋ณด๋ค ํฌ๊ฑฐ๋ ๊ฐ์ผ๋ฉด, ๋ ๊ธด ๊ธธ์ด๋ฅผ ์๋ํ๊ธฐ ์ํด ์ค์๊ฐ๋ณด๋ค ๋ ํฐ ๋ฒ์๋ฅผ ํ์ํ๋ค.
N๋ณด๋ค ์์ผ๋ฉด ์ค์๊ฐ๋ณด๋ค ์์ ๋ฒ์๋ฅผ ํ์ํ๋ค.
์ดํ ์ค์๊ฐ์ ์ ์ฅํ๋ค.
์ฆ ๋ง์ง๋ง์ผ๋ก ์ ์ฅํ ๊ฐ์ด ์ต์ ์ ๊ธธ์ด๊ฐ ๋๋ค.
์ฆ ๋ฒ์์ง์ ์ฆ 1๊ณผ ๋์ ์ ์ง์ ํด์ฃผ๋๊ฒ๋ง ์์ํด๋ ์ ๋ฐ์ด์์ ๋ฌธ์ ๋ฅผ ํ์๋ค๊ณ ์๊ฐ๋๋ ์ฌ์ด ๋ฌธ์ ์์ต๋๋ค.