I got a TLE in one of the subtask 2 cases in JAVA.
I copied my code in cpp, made the necessary changes, and voila!! My code gets accepted!!
I wasted about 15-20 mins converting my code to cpp, which affected my rank.
Can you please do better testing so such cases don’t happen @admin ?
well everyone knows cpp is faster than java but there is a thing called time multiplier different for each language. so that algorithm which runs in cpp in unit sec can run in others languages accordingly.
PS: it might happen that time multiplier isn’t same for each problem.
Java is a favorite among developers, but because the code must first be interpreted during run-time, it’s also slower. C++ is compiled to binaries, so it runs immediately and therefore faster than Java programs. … Java does not support pointers, so you are only able to pass values using value references.
Well i used Fast IO in JAVA too. And yes, i am aware Cpp is faster, but it is the responsibility of testers that JAVA and other programmers coding in other languages don’t get unfair disadvantage due to this.
It is a very naive approximation and simplification to believe that execution time in Java can be expressed as a simple function compared to the one in C++. Whoever thinks that Time(Java) = Multiplier*Time(C++) … should basically forget about Computer Science and change their field
[quote=“fuckingcoding, post:5, topic:36506”]
ecause the code must first be interpreted during run-time, it’s also slower. C++ is compiled to binaries, so it runs immediately and therefore faster than Java programs. … Java does not support pointers, so you are only able to pass values using value references.
they want java users to optimize their code and learn new methods… so make u learn new methods… for which u shouldnt be complaining instead say thanks XD
Many people getting AC doesn’t mean the issue i faced is isn’t valid.
If the same solution in cpp gets AC then don’t you think there was an unfair disadvantage to me?
ur code seems optimal afik but obj creation is costly op. Hence the ‘pair’ might be the reason
also I am not sure if generics affects execution time as they are resolved in compile time
it happens
the tester is not responsible for writing the code in every lang
do u know every lang ?
sad truth man but java is not for CP
I too use java and face this issue in CP