걸림돌
- 쉬운 알고리즘 문제였던 것 같다
코드
total, people = map(int,input().split())
mount = total//people;
remain_mount = total-(mount*people)
print(mount)
print(remain_mount)
`remain_mount = total - (mount*people)` 'remain_mount'에 'people'에게 나눠주고 남은 금액이 들어가야하기 때문에
총 금액인 'total'에서 인당 나눠주는 금액과 사람 수를 곱한 값을 빼면 되기 때문에 total - (mount*people) 의 값을 remain_total에 넣어준다.
'BeakJoon > Python' 카테고리의 다른 글
[Python] 백준 #11399 : ATM (0) | 2023.11.28 |
---|---|
[Python] 백준 #2839번 : 설탕 배달 (1) | 2023.11.28 |
[Python] 백준 #2751번 : 수 정렬하기 2 (1) | 2023.11.11 |
[Python] 백준 #2941번 : 크로아티아 알파벳 [S-V] (1) | 2023.11.09 |
[Python] 백준 1475번 방 번호 [S-V] (1) | 2023.11.09 |