https://www.acmicpc.net/problem/2839
import sys
input=sys.stdin.readline
sugar=int(input())
bag=0
while sugar>=0 :
if sugar%5 ==0:
bag+= (sugar//5)
print(bag)
break
sugar -=3
bag += 1
else:
print(-1)
๊น๋ค๋ก์ ๋ค. ์ ์ผ ์ค์ํ ํคํฌ์ธํธ๋ ๋ฃจํ๋ฅผ ๋ ๋์ 5๋ก๋ ๋๋จธ์ง๋ฅผ ๋น๊ตํ๊ณ , 3์ผ๋ก๋ ๋นผ๋ ๊ฒ์ ์๊ฐํ๋ ๊ฒ์ด๋ค.
'๐ฏ์๊ณ ๋ฆฌ์ฆ > ํ์ด์ฌ ๊ธฐ๋ณธ ์๊ณ ๋ฆฌ์ฆ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
01-1 ์๊ณ ๋ฆฌ์ฆ์ด๋? (0) | 2023.07.01 |
---|---|
[๋ฐฑ์ค/Python] 2675: ๋ฌธ์์ด ๋ฐ๋ณต (0) | 2023.07.01 |
[๋ฐฑ์ค/Python] 15917:๋ ธ์๋ธ ๋ฐฉ์ง๋ฌธ์ ์ผ!! (0) | 2023.07.01 |
[๋ฐฑ์ค/Python] 11006: ๋จ์ฑ์ด์ ๋ญ์ฅ (0) | 2023.07.01 |
[๋ฐฑ์ค/Python] 10886: 0 = not cute / 1 = cute (0) | 2023.07.01 |