Hi! An empty program uses around 20 MB and 61 ms.
Codeforces, what's wrong with you?..
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 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.