psandler wrote:
Frans,
Your post about Sphere Online Judge cost me half of my New Year's Day.
Very neat site--I enjoyed the one problem I did solve.
Yeah it's very addictive
I managed to solve the problem I worked on with code that ran in 2 seconds using C#. I believe my solution was (at least) fairly efficient. Looking at the best solutions for the same problem, I see that several people solved it with code that ran in less than 0.2 seconds using C++.
Is C++ that much faster than C#? I realize that it's just as likely (or more likely) that my code is just not as efficient as I think.
No, they use mono v1.0.1, which is VERY slow. I wrote a textstream to int array routine which barely made it possible to scan the input, left alone do something useful, so it's undoable at the moment to use C#. I posted on the forum to ask them if they could update to mono 1.2.
Is there a way to profile .Net code to see what areas are slow? The whole thing runs in a single method if that makes a difference.
Thanks,
Phil
I think it's best if you revert to C++ for the moment. Then you get decent load times, even with scanf, and you have enough time left for the algorithm.
@Walaa: I couldn't find any problem to solve on topcoder.com. Is topcoder a site which runs your solution as well? (I couldn't find info on that)