HDU-2033 Clock time A+B
Just stimulate the rule of clock time addition.
Just stimulate the rule of clock time addition.
This problem has a regular pattern. Let me show you.
a and b each mod 100 and the answer a + b mod 100
This problem seems like a very huge problem, however, the answers have some certain regular pattern.
The following analysis is from boss Tan when he taught me how to solve this problem. After passing the problem, I sum up his ideas and turned it into words.
Just loop and calculate violently.
This is just stimulation. At first I think the answer was m + m / k . However, I didn't think of that there may be given more than k days more.
Note that the answer can be very huge, so you need to use long long.
C++ has a set of very handy function for set. Here we just use UNION
This is a loop problem, you need to loop x from 1 to MAX to find if there is an x that fits it.