-
시간 세기코테 대비 python/백준 2022. 2. 14. 13:03
출처: 이코테
처음 발상은 구간 별로 나눠서 시간을 세고자 했으나 복잡할 것으로 생각을 바꿈
(
#초 계산 3,13,23,30-39,43,53 =>총 15,#분 계산 동일 15)
그래서 첨부터 그냥 세는 것으로 발상 전환함
n=int(input())count = 0
for i in range(n+1):for j in range(60):
for k in range(60):if "3" in str(i)+str(j)+str(k):count+=1
print(count)'코테 대비 python > 백준' 카테고리의 다른 글
성적이 낮은 순서로 학생 출력하기 (0) 2022.02.16 위에서 아래로 (0) 2022.02.16 미로 탈출 (0) 2022.02.15 음료수 얼려먹기 (0) 2022.02.15 별그리기 (0) 2022.02.13