포럼
문제 ICPC00304

C. Crochet Competition

설명

The National Crochet Pattern Competition (NCPC) is an annual team-based event for crocheters of all skill levels, from beginner to expert. Teams design, write, and crochet original patterns within a time limit, which can range from minutes to a full week depending on the complexity—sometimes spanning weekends. Contestants may take breaks to eat, sleep, or go home, but the timer continues running.

NCPC has asked you to develop a system that calculates the total competition duration from the start and end times, provided with weekday, hour, and minute. The reported duration should be precise, correctly expressed in days, hours, and minutes, using as few components as necessary while minimizing the sum of the integer values.

제약
입력 형식

Input consists of two lines.
- The first line gives the competition's start time.
- The second line gives the competition's end time.

Times are formatted as "Www HH:MM", where
- Www is the three-letter weekday abbreviation: Mon, Tue, Wed, Thu, Fri, Sat, or Sun.
- HH the two-digit hour, from \(00\) to \(23\).
- MM is the two-digits minutes, from \(00\) to \(59\).

If the start and end times are identical, the competition lasts exactly one week.

출력 형식

Output the competition duration in days, hours, and minutes, using the singular or plural form as appropriate (e.g., 1 day, 2 days). List the components in order – days, hours, minutes – separating three components with commas and two with "and"; omit any component with a value of zero.

예제 1
입력
Mon 08:00
Mon 15:00
출력
7 hours
예제 2
입력
Mon 10:00
Wed 08:59
출력
1 day, 22 hours, 59 minutes
예제 3
입력
Fri 20:00
Mon 08:00
출력
2 days and 12 hours
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2025

평가 및 의견

C. Crochet Competition

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

C. Crochet Competition

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8