본문 바로가기
python-algorithm

[백준] 8710

by 무적김두칠 2021. 3. 4.

1
2
3
4
a,b,c=map(int, input().split())
ans=b-a
if ans%c ==0print(ans//c)
elseprint(ans//+1)
cs

처음에는 while로 구현했는데 시간초과나와서 간단한 사칙연산으로 바꿔 구현했습니다.

반응형

'python-algorithm' 카테고리의 다른 글

[백준] 9524  (0) 2021.03.04
[백준] 8723  (0) 2021.03.04
[백준] 6778  (0) 2021.03.03
[백준] 6768  (0) 2021.03.03
[백준] 6764  (0) 2021.03.03

댓글