1009 - Arranging Amplifiers

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
User avatar
ymondelo20
Posts: 1968
Joined: 8 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1009 - Arranging Amplifiers

Post by ymondelo20 » 7 years ago

The Time Limits for problems 1487 and 1830, are fine in my opinion. Both have AC Solutions in Java and C#, of course, generally these are (in terms of quality) good solutions. Increase the Time Limits of the problems trying that, not good solutions in Java and C# can obtain AC, only provoque that very bad solutions in C/C++ can get AC too (cure is worse than the disease).

So, in some cases, you must improve your solutions on others languajes like Java or C#, or try to learn another more fast... By the way, problems that need use of BigInteger types, are the same problem for me, because I use C/C++... ¿Why I don't see anybody complaining for having this advantage in those languages? :)


"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

User avatar
ymondelo20
Posts: 1968
Joined: 8 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1009 - Arranging Amplifiers

Post by ymondelo20 » 7 years ago

The main topic, problem 1009...
Reviewing a little the test data, i see that the input is really huge for Java/C# solutions (and only 1000 MS), so I increased it to 2500 MS. Because we are rejudged, in this case, all submissions for the problem in question, some previously AC (Accepted) submissions now are CE (Compilation Error) or PE (Presentation Error) (because of current version of the COJ). Please, check your solutions looking for this case.
"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

User avatar
jelara
Posts: 37
Joined: 8 years ago
Location: Guadalajara, Mexico
Gender: Male
Mexico

Re: 1009 - Arranging Amplifiers

Post by jelara » 7 years ago

Phantom wrote:I am agreeing with adrianc, because personally, I know program C++, but I dislike it very much. I generally program in Python, C# and Ruby; and for me, get TLE whit good algorithms, now is something normal. I think these problems mustn’t exist. And… specially in this problem, I got a TLE too. We are the 99% :D
Well, perhaps now you'll learn to love C++. Java and C# are great for creating enterprise applications (I personally like C# a lot), but nothing compares to C++ in terms of speed, efficiency and flexibility manipulating the computer's memory. Part of what makes a great programmer is being able to select the right tool for the job ;)

Raudel_UH
Posts: 4
Joined: 8 years ago
Gender: None specified

Are the admins pro c++ ?

Post by Raudel_UH » 7 years ago

To previse accepted solutions in c++ using bad algorithms you lets java solutions a factor for time increasing, what happends that you suspend it.
For the advantage of java over c++ of course that is not a solution that the java coders go to c++ that is completly agains the develoment of the Computer Cience of course that my grandfather prefers assambly code, is'nt it?. The answer is learn java and love it if you don't want the disadvantage .

Titan
Posts: 1
Joined: 7 years ago
Location: CUJAE
Gender: None specified

Re: 1009 - Arranging Amplifiers

Post by Titan » 7 years ago

I think there is one bug in the statement because I had gotten wa and searching in spoj I find it, then I change my code and got ac. Please fix it in order to prevent other users would pass the same. Thanks in advance.
http://coj.uci.cu/24h/problem.xhtml?abb=1009 : "No two amplifier shall be loaded with the same integer."
http://www.spoj.com/problems/ARRANGE/ : "No two amplifier > 1 shall be loaded with the same integer."

User avatar
ymondelo20
Posts: 1968
Joined: 8 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1009 - Arranging Amplifiers

Post by ymondelo20 » 6 years ago

Ok...
You are right.
Statement was updated.

Thanks you.
Grettings.
"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

Post Reply

Return to “Problem set”