Hi everyone.
i was accepting some easy problems and reading peoples code in solution size order.
and in most problems C++ was not best language and vice versa when i was reading solutions in harder problems C++ was better than other languages in solution size.
what do you think about this?
which language is winner?
IMHO, the language does not matter much (if this language does not require you to implement hashmaps, lists, qsorts, priority queues etc manually). If you know C++ libraries well - use it, if not - you may optionally learn java.
I've started training in TC and later CF with the only goal - to practice java. Before that I was programming mainly in C, for about 10 years. My knowledge of C++ stl was extremely weak, but java API provide a great comfort to me.
For TC any problem could be solved in java, since problemsetters write reference solutions in it. I do not know how about CF, but it seems that the only case to prefer C++ is when you are trying some inefficient solution and want to run it as fast as possible. In other cases you find that C++ and java provide very similar abilities, but with C++ you need to be more accurate and attentive. (However if you have great experience with C++, the idea of changing language to java would not be adequate)
For simplest problems also you may want to use perl or python, which allow you some economy of time (if you do not use code templates).
Also java/python/perl is preferable for those rare problems when you may want to use regexps.
a thousand of imps,please, rewrite this code in Java using notepad as IDE:#include <iostream>
int main()
{
long long sum = 0, x = 0;
while (cin>>x, x)
sum += x;
cout<<sum;
}
By the way your code yields compile errors: "cin, cout were not declared in this scope" I shall use comment-editing field right here "as an IDE":
Thank you for accepting this excercise!
Now let us examine another approach:
(thousand devils with this "unclosed math text" - here is a link to solution)
I am not ready to judge which approach is worse. Surely this regexp-work could be expressed even shorter in python/perl, but not many judges allow them...
How are you done darlin after all these years