본문 바로가기
python-algorithm

codeforces 617A - Elephant

by 무적김두칠 2022. 5. 31.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def sol(n):
    ans=0
    while n>0:
        if n>=5:
            n-=5
        elif n>=4:
            n-=4
        elif n>=3:
            n-=3
        elif n>=2:
            n-=2
        elif n>=1:
            n-=1
        ans+=1
    return ans
 
print(sol(int(input())))
cs
반응형

댓글