11372 - Arranging a Contest
Moderator: Board moderators
11372 - Arranging a Contest
I would really love to hear what you feel about this task. I thought it is an easy task, but the statistics seem to show otherwise.
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
I can't comment on that. I'm not a Topcoder member.Monsoon wrote:I think it should be very easy to people who starts in TC. At TC there are often tasks similar to this. But when someone starts only in acm-style contests these type of tasks are rare...
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
I tried to use a [200][3][3][3][3][2][2] table, but, without actually printing a result, I got RTE. I am guessing that was a MLE or something. I guess there is no Java reference solution so we cannot really compare results, right?
For me the order of difficulty was ADCBEF.
What was the intended solution?
For me the order of difficulty was ADCBEF.
What was the intended solution?
-
- New poster
- Posts: 8
- Joined: Sun Aug 06, 2006 3:07 am
I think the intended solution is:
Chose which categories to take the 2 hard problems,2 easy problems and the 2 extra problems.
It could be done with O(4^6) without any tables.
Could you give an explanation about this "brute-force" method.Darko wrote:Yes, I realized later that only 12 of each are relevant, so it can be easily brute-forced.
How does the DP works? You try recursively and store in dp the answer for a subproblem after it has been solved. But what the dimensions mean? Are they the following?The dimension that I used for dp was ::
int dp[201][7][3][3][3][2][2];
Is there any better way?
201 - problem to be used
7 - number of problems already solved
3 - number of hard problems
3 - number of easy problems
3 - number of DP problems
2 - number of graph problems
2 - number of math problems
How is the algorithm to solve this problem using DP?
You do not know whether the path is easy or hard unless you walk through it.
I can tell you my approach that is similar.
You will never use more than 2 problems having the same difficulty and category ( this is the important step ), because you will never need 2 problems having the same difficulty as the problem statement says.
You have 3 difficulty levels, and 4 category's for each one. So you have 12 pairs, and as you wont need more than 2 problems for each pair, you will have to take at most 24 problems ( you will choose trying to get the higher indexed problems, and the most convenient at the lexicographical order ).
When you have this (at most ) 24 problems, you can do a simple brute force, for example choosing 2 Easy problems, 2 Medium's, and two Hard's.
As you have at most 8 problems for each difficulty level, this can be done in less than 8^6 calculations. Eric.
You will never use more than 2 problems having the same difficulty and category ( this is the important step ), because you will never need 2 problems having the same difficulty as the problem statement says.
You have 3 difficulty levels, and 4 category's for each one. So you have 12 pairs, and as you wont need more than 2 problems for each pair, you will have to take at most 24 problems ( you will choose trying to get the higher indexed problems, and the most convenient at the lexicographical order ).
When you have this (at most ) 24 problems, you can do a simple brute force, for example choosing 2 Easy problems, 2 Medium's, and two Hard's.
As you have at most 8 problems for each difficulty level, this can be done in less than 8^6 calculations. Eric.
Yes.black.phoenix wrote: How does the DP works? You try recursively and store in dp the answer for a subproblem after it has been solved. But what the dimensions mean? Are they the following?
201 - problem to be used
7 - number of problems already solved
3 - number of hard problems
3 - number of easy problems
3 - number of DP problems
2 - number of graph problems
2 - number of math problems
Re: 11372 Arranging a Contest
I think algorithm is very easy , but my brute force solution is more than 300 lines and I was writing it about 1 hour...Observer wrote:I would really love to hear what you feel about this task. I thought it is an easy task, but the statistics seem to show otherwise.
Giorgi Saghinadze
http://acm.uva.es/problemset/usersjudge.php?user=32393
http://acm.uva.es/problemset/usersjudge.php?user=32393
Re: 11372 - Arranging a Contest
I say, there may be at most 4 dp-problems, at most 3 math, at most 3 graph, and at most 2 "other" problems. So it is enough if we choose <=2 problems of each type for each difficulty level, indeed arriving at <= 24 problems among which to choose. This problem is more about common sense than programming. Is this what monsoon meant when referring to it as TC-like?
If there is ever a war between men and machines, it is easy to guess who will start it (c) Arthur Clarke