PS/Baekjoon Online Judge
[백준 26561] Population [Python]
kimyoungrok
2023. 5. 29. 17:58
728x90
풀이
p에서 시작해 t초 후 총 몇명이 되는지 계산하면 되는 문제이다.
정확히 4초 또는 7초로 나누어 떨어지지 않으면 아무일도 일어나지 않으니,
t에 대해 죽거나 태어나는 사람의 시간을 나누었을 때의 몫을 구해 계산해주면 된다.
소스코드
출처
26561번: Population
The first line of input will contain a single integer n that indicates the number of lines to follow. Each line will consist of two integers, p and t, where p is the beginning population, and t is the amount of time that will pass. Both p and t will be bet
www.acmicpc.net
728x90