Page 1 of 1

10028 - Demerit Points

Posted: Fri Aug 16, 2002 3:40 pm
by Even
what's wrong? ... I just can't understand...

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

Posted: Fri Feb 20, 2004 11:18 am
by little joey
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]

Re: 10028 - Demerit Points

Posted: Thu Jan 16, 2014 4:13 pm
by forthright48
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).

Re: 10028 - Demerit Points

Posted: Sat Jan 18, 2014 7:56 pm
by EugLim
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?

Re: 10028 - Demerit Points

Posted: Mon Jan 20, 2014 6:45 am
by pandamonium
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).

Re: 10028 - Demerit Points

Posted: Mon Jan 20, 2014 6:23 pm
by forthright48
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.

Re: 10028 - Demerit Points

Posted: Tue Jan 21, 2014 6:05 pm
by dibery
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.

Re: 10028 - Demerit Points

Posted: Tue Jan 21, 2014 9:32 pm
by brianfry713
For the sample input you're printing a space at the end of the first line.

Re: 10028 - Demerit Points

Posted: Wed Jan 22, 2014 2:13 am
by dibery
Thanks, brianfry, but I still got a wrong answer for that.

Re: 10028 - Demerit Points

Posted: Wed Jan 22, 2014 11:08 pm
by brianfry713
Try input:

Code: Select all

2

19820508
19830606 2
19830607 2
19891212 15

19820508

Re: 10028 - Demerit Points

Posted: Thu Jan 23, 2014 6:10 pm
by dibery
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).