1 / 4
Nov 2010

Is multi-threading available when solving? Would it help? If so, could you point me at the API?
TIA

  • created

    Nov '10
  • last reply

    Nov '10
  • 3

    replies

  • 415

    views

  • 2

    users

No and no. wink

The most important part of solving a problem is reducing the operational complexity of your algorithm (big-oh).

Some general notes when using c++:
- avoid using stl as much as possible
- don't use cin/cout, use scanf/printf instead

Cheers.
Also, I had read advice on using fread into a larger-than-needed buffer. But if I do so, would you still go about parsing integers in the buffer using sscanf? Or would that just ruin any speed advantage you got from the fread?

Using sscanf would certainly be a waste. I don't know how confident you are with C/C++, but I would advise using scanf around SPOJ until you get familiar with the environment. Of all the problems that i've solved (LeppyR64) there are very few on the site that would require such a method and it is tedious to code as there are so many finicky input sets.

But by all means, If you want to, go for it.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 13 5d

Want to read more? Browse other topics in C and C++ or view latest topics.