Hi! An empty program uses around 20 MB and 61 ms.
Codeforces, what's wrong with you?..
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3443 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 158 |
5 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | djm03178 | 155 |
9 | TheScrasse | 154 |
10 | Dominater069 | 153 |
Name |
---|
An ultimate proof that Java is slow.
Can you elaborate?
Java is often slower than C++ so I like making fun (example) of using Java in competitive programming, where the running time is (sometimes) crucial.
BTW, I have a problem where Java solution works for 0.8 sec, and C++ solution — 1.0 sec. Solutions are identical and use only arrays and primitive types. There are a lot of floating-point calculations in that problem.
proof or wasn't
I don't see your point.
So the only metric you think is important is runtime? Well, from what I know pure C is a bit faster than C++, why you are using C++ then?
Of course it isn't the only metric (why would you suggest so?). I also like built-in pairs and C++ provides that.
I know that sometimes Java is a better choice, e.g. because it supports big integers. I can't say that Java is a worse language because it's better than C++ in some cases. What I always say is that it's slower (what hurts me often during the problem preparation) — and this is what I say in my trying-to-be-funny comments.
Regarding your last question. Many contests support only C++ and Java, so I'm not going to use C. It's hard for me to find more reasons for not-using-C because I don't know C (and thus I can't compare it with C++).
One can read this to suggest that if language is often slower than another that's the only thing that matters
As for other points I do not see how built-in library matters nowadays in personal contests as you can have any prewritten code you want. And problems with problemsetting may be alleviated by basing your limits on unintended solutoions rather than intended ones, but that's topic for another discussion.
Finally, barring edge cases you can usually submit your c source as c++ ;)
Ok, my words may indeed suggest that, my fault.
I don't know if anyone agrees with me but it isn't that fun to maintain an own library (I'm not sure about this word — I mean a big set of prewritten codes). I understand that there are many cool problems requiring something complicated prewritten (ofc. you can also write it yourself during the contest) but I prefer hmm... simpler problems? Ones that you can code starting from an empty file. Similarly, I would want to read the input without anything pasted into the code. I see that I didn't show here any arguments — I simply don't have any (other than not being used to using much prewritten code). And of course it isn't anymore related to the Java vs. C++ discussion.
Hah. Nice idea with submitting C as C++. Maybe I will even check out C one day. I still want to learn something about SSE first.
It cost 81ms on my laptop...
Java is a language running on virtual machine, so this behaviour is expected.