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.
Yeah man…i have faced this issue on codechef many times
read my above comments again…
. for even better performance you may use brainfuck… but u know what will happen next LOL 
Many people got 100 in Coke2 using java. so i think there is no Java issue…similar thing happened with me in Destroy Cells problem using java…
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?
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
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
I am telling in this respect this is totally crap statement
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
It depends on you/me how you code and how much knowledge you/me have about the language.
eg: better example Arrays.sort() in java…
Exactly!!
Faced the same problem
I guess. Or probably Treeset in JAVA. I got a TLE when i used TreeSet in a recent contest on codechef
You are correct, but if codechef keeps multiple testers like in codeforces then this problem can be reduced to an extent