관리 메뉴

솜씨좋은장씨

[BaekJoon] 5928번 : Contest Timing (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 5928번 : Contest Timing (Python)

솜씨좋은장씨 2022. 11. 14. 12:43
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Contest Timing 입니다.

 

5928번: Contest Timing

Bessie the cow is getting bored of the milk production industry, and wants to switch to an exciting new career in computing. To improve her coding skills, she decides to compete in the on-line USACO competitions. Since she notes that the contest starts on

www.acmicpc.net

🧑🏻‍💻 코드 ( Solution )

from datetime import datetime

def calculate_minute(D, H, M):
    return D * 24 * 60 + H * 60 + M


def contest_timing(D, H, M):    
    start_time = calculate_minute(D=11, H=11, M=11)
    end_time = calculate_minute(D=D, H=H, M=M)
    
    contest_time = end_time - start_time
    
    if contest_time < 0:
        contest_time = -1
    
    return contest_time


if __name__ == "__main__":
    D, H, M = map(int, input().split())
    
    print(contest_timing(D=D, H=H, M=M))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments