Logo
(追記) (追記ここまで)

20746번 - Entering the Time 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB77301642.105%

문제

Arghs! Yet again, all the clocks in Petra's home show the wrong time due to a power outage that occurred while she was sleeping. This means she has to spend her day resetting all the clocks to the correct time. Now, you might not consider this a big deal. After all, how many clocks does any single household really have? Well, Petra just so happens to be a collector of clocks. She literally has hundreds of clocks -- and that is just in her bedroom! Thus, it is understandable that she does not look forward to all this resetting.

You, as her friend, would prefer if she did not need to spend her entire day resetting all her clocks. Especially since this means she would not have any time to play with you! If only you could construct some automated way of entering the correct time into all the clocks, perhaps through some kind of computer code...

A-ha, of course! You can write a program to determine how to set the correct time as quickly as possible!

Each clock has a display of 4ドル$ digits: two are used to display the hour (between 00 and 23), and two are used to display the minute (between 00 and 59). The time can be changed by selecting a digit and either decreasing or increasing by 1ドル$. Decreasing a digit that is 0ドル,ドル it is turned into 9ドル,ドル and increasing a digit 9ドル$ turns it into 0ドル$. However, the clock can not display invalid times. This means that at any given time, the hour must be between 00 and 23 and the minute between 00 and 59.

Write a program that, given the original time of a clock and the current time, determines how to set the clock correctly.

입력

The input consists:

  • one line with the time that the clock is currently set to.
  • one line with the current time.

Each time has the format hh:mm, where hh is a two-digit number between 00 and 23, and mm is a two-digit number between 00 and 59.

출력

The first line contains the number of different times seen on the clock when setting it correctly. Then for each time output it on the same format as above hh:mm on a separate line. Include both the original time and the final time.

제한

예제 입력 1

00:00
01:01

예제 출력 1

3
00:00
01:00
01:01

예제 입력 2

00:08
00:00

예제 출력 2

3
00:08
00:09
00:00

예제 입력 3

09:09
20:10

예제 출력 3

6
09:09
09:00
09:10
00:10
10:10
20:10

힌트

출처

Contest > Swedish Coding Cup > LTH Challenge 2017 E번

  • 문제를 만든 사람: Johan Sannemo
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /