10028 - Demerit Points

All about problems in Volume 100. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Even
Learning poster
Posts: 75
Joined: Thu Nov 22, 2001 2:00 am
Location: Taiwan

10028 - Demerit Points

Post by Even » Fri Aug 16, 2002 3:40 pm

what's wrong? ... I just can't understand...

is it judge wrong?? help ... @@

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Fri Feb 20, 2004 11:18 am

Don't assume the input description is correct, it'll get you WA. The guy who concatenated the input cases from the original contest to make it a multi input problem probably left out or inserted one or more newline(s). I don't know which.[/code]

forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh
Contact:

Re: 10028 - Demerit Points

Post by forthright48 » Thu Jan 16, 2014 4:13 pm

Finally AC! Here are some test cases to make things clearer:

Code: Select all

Input:
2

12340101
12360101 2

12340101
12540101 2

Code: Select all

Output:
1234-01-01 No merit or demerit points.
1236-01-01 1 merit point(s).
1236-01-01 No merit or demerit points.
1238-01-01 1 merit point(s).
1240-01-01 2 merit point(s).
1242-01-01 3 merit point(s).
1244-01-01 4 merit point(s).
1246-01-01 5 merit point(s).

1234-01-01 No merit or demerit points.
1236-01-01 1 merit point(s).
1238-01-01 2 merit point(s).
1240-01-01 3 merit point(s).
1242-01-01 4 merit point(s).
1244-01-01 5 merit point(s).
1246-01-01 6 merit point(s).
1248-01-01 7 merit point(s).
1250-01-01 8 merit point(s).
1252-01-01 9 merit point(s).
1254-01-01 10 merit point(s).
1254-01-01 9 merit point(s).
Last edited by forthright48 on Sun Jan 19, 2014 9:13 am, edited 1 time in total.
What ever happens, happens for good. Even when we get WA :p
http://www.forthright48.com

EugLim
New poster
Posts: 1
Joined: Sat Jan 18, 2014 7:52 pm

Re: 10028 - Demerit Points

Post by EugLim » Sat Jan 18, 2014 7:56 pm

I'm getting WA for this, is there anyone who might be able to provide some critical test data?

Also, my output is different from the one that forthright48 posted for the second test case. Can anyone verify?

pandamonium
New poster
Posts: 1
Joined: Mon Jan 20, 2014 6:08 am

Re: 10028 - Demerit Points

Post by pandamonium » Mon Jan 20, 2014 6:45 am

I also ACed the problem and forthright48's output shouldn't be correct because the problem states "A merit point is given, to a maximum of five" unlike the given output which has 10 merit points awarded. I think the output should be as follows.

Input:

Code: Select all

2

12340101
12360101 2

12340101
12540101 2
Output:

Code: Select all

1234-01-01 No merit or demerit points.
1236-01-01 1 merit point(s).
1236-01-01 No merit or demerit points.
1238-01-01 1 merit point(s).
1240-01-01 2 merit point(s).
1242-01-01 3 merit point(s).
1244-01-01 4 merit point(s).
1246-01-01 5 merit point(s).

1234-01-01 No merit or demerit points.
1236-01-01 1 merit point(s).
1238-01-01 2 merit point(s).
1240-01-01 3 merit point(s).
1242-01-01 4 merit point(s).
1244-01-01 5 merit point(s).
1254-01-01 4 merit point(s).
1256-01-01 5 merit point(s).

forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh
Contact:

Re: 10028 - Demerit Points

Post by forthright48 » Mon Jan 20, 2014 6:23 pm

I guess the judge data is weak then. I too limited merits to maximum of 5. Then I got lots of WA and so started to try out different things. Later I found bugs and fixed them. By the time I was finished my code no longer restricted merits to max of 5.
What ever happens, happens for good. Even when we get WA :p
http://www.forthright48.com

dibery
Learning poster
Posts: 76
Joined: Sat Feb 23, 2013 4:16 pm
Location: Taiwan, Taipei
Contact:

Re: 10028 - Demerit Points

Post by dibery » Tue Jan 21, 2014 6:05 pm

I tried some cases and the result seemed reasonable.
I also checked the data in this thread but still couldn't find the errors.
Can someone please help me out?
Any advice will be appreciated.

Code: Select all

Accepted.
Last edited by dibery on Fri Jan 24, 2014 6:12 am, edited 1 time in total.
Life shouldn't be null.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10028 - Demerit Points

Post by brianfry713 » Tue Jan 21, 2014 9:32 pm

For the sample input you're printing a space at the end of the first line.
Check input and AC output for thousands of problems on uDebug!

dibery
Learning poster
Posts: 76
Joined: Sat Feb 23, 2013 4:16 pm
Location: Taiwan, Taipei
Contact:

Re: 10028 - Demerit Points

Post by dibery » Wed Jan 22, 2014 2:13 am

Thanks, brianfry, but I still got a wrong answer for that.
Life shouldn't be null.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10028 - Demerit Points

Post by brianfry713 » Wed Jan 22, 2014 11:08 pm

Try input:

Code: Select all

2

19820508
19830606 2
19830607 2
19891212 15

19820508
Check input and AC output for thousands of problems on uDebug!

dibery
Learning poster
Posts: 76
Joined: Sat Feb 23, 2013 4:16 pm
Location: Taiwan, Taipei
Contact:

Re: 10028 - Demerit Points

Post by dibery » Thu Jan 23, 2014 6:10 pm

Thanks, brianfry.
Your advice was so helpful and I found other mistakes in my code.

Here's a test for someone may encounter the same problem with me.

Input:

Code: Select all

3

19820508
19830606 2
19830607 2
19891212 15

19820508

19820509
19830606 2
19830607 2
19891212 15
Output:

Code: Select all

1982-05-08 No merit or demerit points.
1983-06-06 2 demerit point(s).
1983-06-07 4 demerit point(s).
1984-06-07 2 demerit point(s).
1985-06-07 No merit or demerit points.
1987-06-07 1 merit point(s).
1989-06-07 2 merit point(s).
1989-12-12 11 demerit point(s).
1990-12-12 5 demerit point(s).
1991-12-12 2 demerit point(s).
1992-12-12 No merit or demerit points.
1994-12-12 1 merit point(s).
1996-12-12 2 merit point(s).
1998-12-12 3 merit point(s).
2000-12-12 4 merit point(s).
2002-12-12 5 merit point(s).

1982-05-08 No merit or demerit points.
1984-05-08 1 merit point(s).
1986-05-08 2 merit point(s).
1988-05-08 3 merit point(s).
1990-05-08 4 merit point(s).
1992-05-08 5 merit point(s).

1982-05-09 No merit or demerit points.
1983-06-06 2 demerit point(s).
1983-06-07 4 demerit point(s).
1984-06-07 2 demerit point(s).
1985-06-07 No merit or demerit points.
1987-06-07 1 merit point(s).
1989-06-07 2 merit point(s).
1989-12-12 11 demerit point(s).
1990-12-12 5 demerit point(s).
1991-12-12 2 demerit point(s).
1992-12-12 No merit or demerit points.
1994-12-12 1 merit point(s).
1996-12-12 2 merit point(s).
1998-12-12 3 merit point(s).
2000-12-12 4 merit point(s).
2002-12-12 5 merit point(s).
Life shouldn't be null.

Post Reply

Return to “Volume 100 (10000-10099)”