#P5690. [CSP-S 2019 江西] 日期
[CSP-S 2019 江西] 日期
Description
Alice wrote a date on paper in the form , where and are both two-digit numbers representing the month and the day, respectively. However, this date may not actually exist. Alice asked Bob to change the digits in some positions so that the date becomes valid. Please help Bob compute the minimum number of digits he needs to change.
In this problem, February is fixed to have days.
Input Format
A single line containing a string of five characters, representing .
Output Format
A single line containing one integer, representing the answer.
03-32
1
02-39
1
67-89
2
Hint
[Explanation for Sample Input/Output 1]
There is more than one way to change it. One possible result is: .
[Explanation for Sample Input/Output 2]
One possible result is: .
[Explanation for Sample Input/Output 3]
One possible result is: .
[Constraints]
For of the testdata, and are guaranteed to be digits.
update: 2024/07/04 Added one hack case.
Translated by ChatGPT 5
京公网安备 11011102002149号