본문 바로가기
python-algorithm

백준 15080 Every Second Counts

by 무적김두칠 2022. 12. 4.

https://www.acmicpc.net/problem/15080

 

15080번: Every Second Counts

Meredith runs a taxi service called Ruber which offers rides to clients in small towns in western Pennsylvania. She wants to get every possible dime out of people who use her taxis, so her drivers charge a flat fee not per minute but per second. It’s imp

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
if __name__ == '__main__':
    start_hh, start_mm, start_ss =map(int,input().split(':'))
    end_hh, end_mm, end_ss = map(int, input().split(':'))
    start_total = start_hh*3600 + start_mm*60 + start_ss
    end_total = end_hh*3600 + end_mm*60 + end_ss
    answer = end_total-start_total
    if end_total<start_total:
         answer+= 24*3600
    print(answer)
cs
반응형

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

백준 6438 Reverse Text  (1) 2022.12.05
백준 13234 George Boole  (0) 2022.12.05
백준 26209 Intercepting Information  (0) 2022.12.04
백준 14625 냉동식품  (0) 2022.12.03
백준 5698 Tautogram  (0) 2022.12.03

댓글