HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "Question - 1"

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanJune.04.2017 at 08:24:11 AM
0--- Test 1 ---
8 4
29-10-1930 29-10-1990
29-10-1970 29-10-1990
29-10-1980 29-10-1990
29-10-1920 29-10-1960
29-10-1960 29-10-1970
29-10-1940 29-10-1980
29-10-1910 29-10-1990
29-10-1940 29-10-1990

--- Pattern ---
7 1 8 4

imesecanJune.04.2017 at 08:30:33 AM
1When the question says,
"If two people have lived the same number of years, then check and compare according to the months and days..."
It means "If they are the same exact age or if they have lived the same number of days". They may be born on different years but they may be the same exact age.

One way for this question: You can calculate the number of days from the dates given.
nBirthDays = bYear*360 + bMonth*30 + bDay;
nDeathDays = dYear*360 + dMonth*30 + dDay;
numDaysLived = nDeathDays - nBirthDays;

Then you can compare the numDaysLived and id.


www.contester.ru