The C++ vs Java Problem

Discussion on C, C++ and C++11 at the COJ. This is the place to clear your doubts about these languages, and to share with the community the new things you learn about them.
Raudel_UH
Posts: 4
Joined: Fri Nov 25, 2011 2:46 pm
Gender: None specified

The C++ vs Java Problem

Postby Raudel_UH » Mon Nov 05, 2012 12:09 am

First of all everybody knows that c, c++ and Java are the ACM language used at competition and everybody knows that there are still more users coding at c++ than java but
in the last years the java coders are increasing fastly because of the posibilities that the language offers.
The COJ has become the principal Online Judge of all Caribbean because of that the administrators has to be very carefuly with the user´s opinion and advices and principally with the errors on real competition.
It is true that are some problems that can be accepted in c++ and with the same algorithms you got TLE in Java and that shouden't happend in any training Online Judge but that is nothing compared to geting that in a real competition.
The trouble is that in the 2011 Cuban Final the problem Death Squads 1569 was accepted by a team using the trivial solution in c++.
The time was setted at 10 sec and they get 9.4 sec so they obtain an advantage over every team that codes in Java in all sense because
even if you code the problem with the expected solution you spent much more time on it and that is just unacceptable in a Cuban Final.
This year the competition was ok on the finals but in the BOCA.uci.cu training contest we got again a fright. The problem "money"
was accepted only in c++ because in java with the same exactly algorithms you got TLE. I just don't like when someone writes an excuses without arguments.
I just hope that in the Caribbean Regionals there will be no trouble with the difference between languages. A philosophic way to see why it is a problem:
"if i think as good as you, i will be contributing as much as you to the humanity, no matter the barrage of the language".
I have posted before this but i think is important so i put it here too:
To previse accepted solutions in c++ using bad algorithms you lets java solutions a factor for time increasing to match the languages in time matter,
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 Science
of course that my grandfather prefers assambly code, is'nt it?.
PD: I don't want to criticize no body, in fact i know some admins and they are very good persons and prepared proffesionals that are helping a lot the develoment of the
computer science in Cuba.



george
COJ Developer
Posts: 43
Joined: Wed Oct 26, 2011 10:49 pm
Gender: None specified

Re: The C++ vs Java Problem

Postby george » Mon Nov 05, 2012 11:34 pm

It is true that are some problems that can be accepted in c++ and with the same algorithms you got TLE in Java and that shoudn't happend in any training Online Judge but that is nothing compared to geting that in a real competition.


Off course as you refers, sometimes happens that you need to write the most efficient algorithm to get AC in java.

The trouble is that in the 2011 Cuban Final the problem Death Squads 1569 was accepted by a team using the trivial solution in c++.
The time was setted at 10 sec and they get 9.4 sec so they obtain an advantage over every team that codes in Java in all sense because
even if you code the problem with the expected solution you spent much more time on it and that is just unacceptable in a Cuban Final.


if you spent much more time coding in java compare with the time someone else spent coding in c++, you should start thinking in learning how to code in c++, no to give up java but to posses other tools to face a variaty of tasks.

This year the competition was ok on the finals but in the BOCA.uci.cu training contest we got again a fright. The problem "money"
was accepted only in c++ because in java with the same exactly algorithms you got TLE


same as before

I just don't like when someone writes an excuses without arguments.
I just hope that in the Caribbean Regionals there will be no trouble with the difference between languages


Nobody is giving you worthless excuses, first you should know that there is a Latin American Judges Comitee in charge of creating and testing the problems so this problem you are reporting should not ocurred, on the other hand you should know that "Boca" is a system that is not develop by us so any complain about it, should be express in their official site.

To previse accepted solutions in c++ using bad algorithms you lets java solutions a factor for time increasing to match the languages in time matter,
what happends that you suspend it.


I think this is not the solution because bad algorithm in c++ will remain ac, so taking into account that java is by far slower thaN c/c++ you should as i said earlier GIVE C++ A CHANCE, believe me, it will help. On the other hand the officials contests systems did not give java a factor for increasing the time.

A few tips that could/not help you.

If you are a coder in java, for the acm-icpc, always take into account that:
- your solutions most of the time will be at the edge and your algorithms should be the most eficients
- Scanner is by far slower than BufferReader.
- Try to use StringTokenizer, it is faster.
- Don't give up C++, sometimes it is pretty usefull.

hope this help you.

User avatar
JJRZ
Posts: 13
Joined: Tue Nov 29, 2011 5:03 pm
Location: UH
Gender: None specified

Re: The C++ vs Java Problem

Postby JJRZ » Fri Nov 09, 2012 6:56 pm

Raudel_UH wrote:...
in the last years the java coders are increasing fastly because of the posibilities that the language offers.
...
It is true that are some problems that can be accepted in c++ and with the same algorithms you got TLE in Java
...
I just hope ... there will be no trouble with the difference between languages.
...
"if i think as good as you, i will be contributing as much as you to the humanity, no matter the barrage of the language".
...
...the java coders go to c++ that is completly agains the develoment of the Computer Science
of course that my grandfather prefers assambly code, is'nt it?.


Imagine that we began to program with "1" and "0" so that the programs will be the quickest (even that c/c++). What would it happen?? Would all begin to program this way only because the time would be smaller??
Raudel I'm with you

User avatar
luismawolf
Posts: 30
Joined: Thu Nov 13, 2014 3:12 pm
Gender: Male

Re: The C++ vs Java Problem

Postby luismawolf » Tue Jun 14, 2016 10:10 am

Trabajar con cadenas en c,c++, c++11 en una pesadilla. Por ejemplo trabajar con diferentes bases y conversiones.

User avatar
isaac
Posts: 83
Joined: Mon Oct 26, 2015 6:20 pm
Gender: None specified

Re: The C++ vs Java Problem

Postby isaac » Fri Jun 17, 2016 8:06 am

Yo creo que trabajar con cadenas en cualquier lenguaje depende de la experiencia que tenga la persona en ese lenguaje y el dominio de las funciones que permiten la manipulacion de estas. Si no las conoces o no las dominas en su totalidad, puede ser una pesadilla pero si las dominas, no creo que sea asi. Como esta seccion es de C++ Vs Java, le voy a dar a C++ la ventaja exponiendo uno de los principales disgustos que los que programamos en C++ nos llevamos cuando aprendemos Java, la sobrecarga de operadores. Eso es no discutible ya que Java no la posee.


Return to “C/C++/C++11”

Who is online

Users browsing this forum: No registered users and 1 guest