790 - Head Judge Headache
Moderator: Board moderators
790 - Head Judge Headache
Hi all,
There's something strange with problem 790. Although I can get the right results with some very complex test cases here, I always get wrong answer.
Does a team that did not submit any problem be listed or not? That is, if team 1 submits and team 4 submits too, do teams 2 and 3 be listed in output too?
The only thing that may cause confusion is this (and this should be explained on problema description).
Thanks
Rafael
There's something strange with problem 790. Although I can get the right results with some very complex test cases here, I always get wrong answer.
Does a team that did not submit any problem be listed or not? That is, if team 1 submits and team 4 submits too, do teams 2 and 3 be listed in output too?
The only thing that may cause confusion is this (and this should be explained on problema description).
Thanks
Rafael
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Yes, you need to list all teams even it they doesn't has a single submission.
Here is the tricks that I've found in this problem (I've already posted them in old message board):
1) Output in ranklist all teams which numbers less then or equal to largest team number in input.
2) Don't count any more runs [for this problem] if problem already accepted.
3) If rejected run and accepted run happens at the same time then count rejected run as usual (+20 min).
4) Time can be given in non-increasing order (like it shown in sample input).
Here is the tricks that I've found in this problem (I've already posted them in old message board):
1) Output in ranklist all teams which numbers less then or equal to largest team number in input.
2) Don't count any more runs [for this problem] if problem already accepted.
3) If rejected run and accepted run happens at the same time then count rejected run as usual (+20 min).
4) Time can be given in non-increasing order (like it shown in sample input).
Hi!
My solution is also getting WA and I've checked all 4 conditions mentioned. So, is there any other condition?
If a team has submitted, but solved no problems, it should appear before the other who did not submitted?
Do I increase the rank of teams with no submissions or they receive the same rank like the teams with same score?
Thanks!
Jo
My solution is also getting WA and I've checked all 4 conditions mentioned. So, is there any other condition?
If a team has submitted, but solved no problems, it should appear before the other who did not submitted?
Do I increase the rank of teams with no submissions or they receive the same rank like the teams with same score?
Thanks!
Jo
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
No.jpfarias wrote:If a team has submitted, but solved no problems, it should appear before the other who did not submitted?
They receive same score.jpfarias wrote:Do I increase the rank of teams with no submissions or they receive the same rank like the teams with same score?
My sorting function looks like:[c]int tcompare(const void *op1, const void *op2)
{
TEAM *p1 = (TEAM *)op1;
TEAM *p2 = (TEAM *)op2;
if (p1->active > p2->active) return -1;
if (p1->active < p2->active) return 1;
if (p1->solved > p2->solved) return -1;
if (p1->solved < p2->solved) return 1;
if (p1->ttime < p2->ttime) return -1;
if (p1->ttime > p2->ttime) return 1;
if (p1->num < p2->num) return -1;
if (p1->num > p2->num) return 1;
return 0;
}[/c]
Also small test, input:[c]1
1 A 0:50 N
3 A 1:12 Y
2 B 1:19 N
1 A 1:20 Y
2 B 1:35 N
1 B 1:36 N
3 B 1:40 Y
3 C 1:41 N
4 A 1:40 Y
9 D 0:20 Y[/c]Output:[c]RANK TEAM PRO/SOLVED TIME
1 3 2 172
2 9 1 20
3 1 1 100
3 4 1 100
5 2
5 5
5 6
5 7
5 8[/c]
Hi!
My solution give the right output for yours input.
here is my compare function:
[cpp]
int comp(const void *c1, const void *c2) {
Team *t1 = (Team *)c1;
Team *t2 = (Team *)c2;
if (t1->num_solved != t2->num_solved) {
return t2->num_solved - t1->num_solved;
}
if (t1->time != t2->time) {
return t1->time - t2->time;
}
return t1->team_num - t2->team_num;
}
[/cpp]
What's that active attribute?
Thanks, see ya!
Jo
My solution give the right output for yours input.
here is my compare function:
[cpp]
int comp(const void *c1, const void *c2) {
Team *t1 = (Team *)c1;
Team *t2 = (Team *)c2;
if (t1->num_solved != t2->num_solved) {
return t2->num_solved - t1->num_solved;
}
if (t1->time != t2->time) {
return t1->time - t2->time;
}
return t1->team_num - t2->team_num;
}
[/cpp]
What's that active attribute?
Thanks, see ya!
Jo
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Try this input:
Your solution gives:
My solution answer is:
Code: Select all
1
2 A 8:04 N
2 A 15:59 N
2 A 18:35 N
2 A 20:29 Y
2 B 10:28 Y
2 B 17:49 Y
2 C 6:57 Y
2 C 11:06 N
2 C 13:33 Y
2 C 14:25 N
2 C 21:34 Y
2 C 22:41 N
2 C 23:01 Y
2 C 23:21 Y
2 D 1:11 Y
2 D 18:50 N
2 D 22:33 Y
2 E 16:36 Y
2 E 17:09 Y
2 E 17:49 Y
2 E 20:39 N
2 F 0:20 N
2 F 7:01 N
2 F 8:08 N
2 F 9:51 Y
2 G 6:08 Y
2 G 11:22 N
2 G 13:07 Y
2 G 14:10 Y
Code: Select all
RANK TEAM PRO/SOLVED TIME
1 2 7 4580
2 1
Code: Select all
RANK TEAM PRO/SOLVED TIME
1 2 7 4420
2 1
What do you mean by that?Ivan Golubev wrote:3) If rejected run and accepted run happens at the same time then count rejected run as usual (+20 min).
Can you illustrate this in an example?
Btw, I wonder why none of the correct submissions for this qq is in Pascal!!!!!!!!



7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
It's very strange...
Ivan Golubev said,
It seems like error of online-judge program.
How can we know that largest team who have submitted is the largest.
(Before I read this topic, I have programmed with the team who have submitted.)
If we have to check largest team number , then why don't we have to check smallest team number.
We have to said to judge, 'please add description'
It's very strange to me. (eventhough I did not sent my solution yet.)1) Output in ranklist all teams which numbers less then or equal to largest team number in input.
It seems like error of online-judge program.
How can we know that largest team who have submitted is the largest.
(Before I read this topic, I have programmed with the team who have submitted.)
If we have to check largest team number , then why don't we have to check smallest team number.

We have to said to judge, 'please add description'
A farmer learns more from a bad harvest than a good one.
790
I am sorting the input log, assigning rank on the basis
of whether the team has at least 1 problem solved.
What else am I supposed to do to get AC?
of whether the team has at least 1 problem solved.
What else am I supposed to do to get AC?