Page 3 of 3
Posted: Sun Aug 27, 2006 6:17 am
If there is still a conflict, order them by their appearance in the input stream.

Maybe this is the problem? And the change you made simply made it possible to happen?.

The sample output seems to state to order by date first. It is very fuzzy.

I agree that the problem is not too clear, but it doesn't seem that the correct solution is to not sort it by date first. The relative importance has a good relation with date so it shall work the same for the inputs the judge has. I made a search and this guy seems to have sorted by date first and got AC:

http://acm.uva.es/board/viewtopic.php?t=3715
This problem is not very clearly specified, I tried many possible interpretations before getting accepted. And it took me a long time to get rid of a PE, because i didnt realize the date after Today is: must also be right aligned in a field of 3.
The order is by date, then by priority displayed, then by input order. Notice if two events on the same day have different priority, when asked for that day, these events should be ordered by their input order, since the priority displayed are both *TODAY*.
Agreed, this problem is a guessing game. And there are many more problems like this in the archive.
Well, if you think about it, in this case *today* did have the same number of 'stars' and certainly relative importance, and the problem does say to order by input if there are problems.

Sometimes I wish the problems had more complete input examples but it seems that to the problem designers figuring out the possible catches is part of solving a problem. Makes sense since in real life problem solving no one will tell you the catches.

Posted: Sun Aug 27, 2006 2:31 pm
Vexorian wrote: Makes sense since in real life problem solving no one will tell you the catches.
How true indeed.

Posted: Sun Jan 07, 2007 11:06 am
Vexorian wrote: Well, if you think about it, in this case *today* did have the same number of 'stars' and certainly relative importance, and the problem does say to order by input if there are problems.
*today* is simply the notation and is not related to the relative importance. It is not logical to list a less priority event before the higher one. If you think about it, why the lower priority event is listed before the higher one just for today but not tomorrow or the date after tomorrow?

There is at least another contest which used the same problem treated the relative importance logically.
Sometimes I wish the problems had more complete input examples but it seems that to the problem designers figuring out the possible catches is part of solving a problem.
Provided that the problem description is not ambiguous.
Makes sense since in real life problem solving no one will tell you the catches.
But you will be told what exactly is wrong. A user won't just said WA and ignored you when you asked what's wrong.

### output?

Posted: Thu Nov 22, 2007 2:24 pm
Hi friends,
someone have AC output to this input?

Code: Select all

1999
A 23 12 5 Partner's birthday
A 25 12 7 Christmas
A 20 12 1 Unspecified Anniversary
A 25 12 7 Christmas So Important
A 26 12 6 Boxing Day
A 26 12 6 Christmas Eve + 2
A 1 1 6 New Year
A 31 12 6 New Year Eve
A 1 1 7 New Year Again
A 2 1 4 Nothing
A 1 3 4 First Day of March
A 28 2 4 Feb Regular
D 31 12
#
have too others outputs and inputs AC

### AC

Posted: Thu Nov 22, 2007 3:39 pm
Thaks,
I take AC.
the output is:

Code: Select all

Today is: 31 12
31 12 *TODAY* New Year Eve
1  1 ******* New Year Again
1  1 ******  New Year
2  1 ***     Nothing

### Re: 158... poor wording?

Posted: Sat Apr 25, 2009 6:08 am
Oh garbage! Print the numbers after "Today is:" in fields of width 2 as well. After 5 years, I finally got rid of the Presentation Error and got AC.

### calendar 158

Posted: Sun Nov 18, 2012 12:51 am
i have think about it three days?but WA WA?????
anyone can help me?
if you have ACed?can you share your code to me???

my email is?anonysecurity@gmail.com

### Re: calendar 158

Posted: Tue Nov 20, 2012 12:00 am

### Re: 158 - Calendar - WA

Posted: Tue Feb 26, 2013 4:41 pm
in case someone needs...

pNewEvent->pNext = NULL;

should be

pNewEvent->pNext = pEventTemp->pNext; //NULL;

### Re: 158 - Calendar - WA

Posted: Tue Feb 26, 2013 6:29 pm
Well I'll be! I've been looking at this problem for a long time. Thanks for the help!

PS
I used to post under the El-idioto pseudonym, so I'm the dummy who didn't figure out what his problem was.

### Re: i finally figured it out

Posted: Thu Jun 19, 2014 12:59 pm
shuniu said
This problem is not very clearly specified... Notice if two events on the same day have different priority, when asked for that day, these events should be ordered by their input order, since the priority displayed are both *TODAY*.
After reading this post i finally got acc. Why the problem statement is still haven't changed. How can we understand that : if two events on the same day have different priority, when asked for that day, these events should be ordered by their input order, since the priority displayed are both *TODAY* from the current problem statement?

### Re: 158 - Calendar

Posted: Sat Apr 30, 2016 1:35 pm
Finally got accepted. Besides the confusion mentioned in the above post, there is no need to append a blank line in the last block. It should be noted that the udebug version requires a blank line in the last blank.

PS: a test case to help to understand the unclear description
if two events on the same day have different priority, when asked for that day, these events should be ordered by their input order, since the priority displayed are both *TODAY*

Code: Select all

1993
A 3 3 5 Partner's birthday
A 1 3 1  Unspecified Anniversary
A 2 1 7 Wedding Anniversary
A 1 1 6 Max's birthday
A 1 1 7 New Year's Day
A 2 1 6 Allen's birthday
D 1 1
#
The output:

Code: Select all

Today is:  1  1
1  1 *TODAY* Max's birthday
1  1 *TODAY* New Year's Day
2  1 ******* Wedding Anniversary
2  1 ******  Allen's birthday

### Re: 158 - Calendar

Posted: Tue Feb 21, 2017 8:12 am
I got my solution accepted after spending a few hours working with a presentation error, even though the uDebug outputs were the same with my solution. I was using C++11.

So I'm pretty sure the problem was that I was using both iostream for cin as well as printf for output. I was using this without std::ios::sync_with_stdio(false) set. I'm not sure what causes this to get a presentation error, but my last ditch effort to fix the issue was to remove iostream and write the whole answer using cstdio.

### Re: 158 - Calendar

Posted: Thu Aug 03, 2017 5:43 am
Hi, there, my tip for you if you are suffering is to generate all dates in the range of the problem or at least one year with leap day and one year without it for all priorities in all days and then look in the generated answer for errors. And the correct order is DAY / PRIORITY / INPUT ORDER (for days marked as *TODAY* the correct order is INPUT ORDER only and they should be on the top of the group).

Good luck

### Re:

Posted: Thu Aug 03, 2017 6:04 am
yiuyuho wrote:
Fri Jan 17, 2003 12:37 am
Will there be events that lieing over several days? Or will there be events of the same name? If so, do we need to output both of the event?

What's the output to:
1980
A 3 1 7 1-3-7
A 2 1 7 1-3-7
D 1 1
#

????????
From my AC code:

Code: Select all

Today is:  1  1
2  1 ******* 1-3-7
3  1 ******  1-3-7