Could someone advise me on how some authors achieve such good performance for the problems in C++? For example do they just write the code in embedded assembly or are there some good C++ performance tips I can use?
Also, are our submissions compiled in debug mode with no optimizations? Might it be possible to use #pragma directives to change compile settings?
Thanks, I look forward to your replies!
64 Memory and ~0 CPU, How? #pragma with online-judge?
Moderator: Board moderators
64 Memory and ~0 CPU, How? #pragma with online-judge?
Last edited by alternate on Sat Jul 29, 2006 11:38 am, edited 1 time in total.
Basically, code like you're coding C, use pointers, arrays, tight loops, etc. Minimize the number of overall operations as best you can. I haven't done any problems without using simple loops and compares, though I suspect I could using classes and functions, it just seems like overkill. I dunno though, I'll be honest and say some of these problem sets have crushed me...
...what problems are you getting TLE on or just wondering on how you might improve?
...what problems are you getting TLE on or just wondering on how you might improve?
I'm wondering about the very high performance programs i.e. 64 memory and ~0 CPU time, and also about improving the performance of my own while still using the standard C++ classes e.g. "use lists instead of vectors in this case" and maybe compiler settings.
I am actually getting a TLE on 108 "Maximum Sum". I think I need to improve the efficiency of my algorithm. I have 6 loops I need to reduce to 3 or 4. I suspect there's a standard technique to aid this.
If anyone could give me any advice relating to these matters I'd appreciate it.
Thanks
I am actually getting a TLE on 108 "Maximum Sum". I think I need to improve the efficiency of my algorithm. I have 6 loops I need to reduce to 3 or 4. I suspect there's a standard technique to aid this.
If anyone could give me any advice relating to these matters I'd appreciate it.
Thanks