10028 - Demerit Points
Moderator: Board moderators
10028 - Demerit Points
what's wrong? ... I just can't understand...
is it judge wrong?? help ... @@
is it judge wrong?? help ... @@
- little joey
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
-
- New poster
- Posts: 37
- Joined: Wed Mar 14, 2012 11:57 am
- Location: Bangladesh
- Contact:
Re: 10028 - Demerit Points
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.
Re: 10028 - Demerit Points
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?
Also, my output is different from the one that forthright48 posted for the second test case. Can anyone verify?
-
- New poster
- Posts: 1
- Joined: Mon Jan 20, 2014 6:08 am
Re: 10028 - Demerit Points
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:
Output:
Input:
Code: Select all
2
12340101
12360101 2
12340101
12540101 2
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).
-
- New poster
- Posts: 37
- Joined: Wed Mar 14, 2012 11:57 am
- Location: Bangladesh
- Contact:
Re: 10028 - Demerit Points
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
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.
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.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10028 - Demerit Points
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!
Re: 10028 - Demerit Points
Thanks, brianfry, but I still got a wrong answer for that.
Life shouldn't be null.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10028 - Demerit Points
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!
Re: 10028 - Demerit Points
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:
Output:
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
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.