|
|
back to boardFinally AC && Slow C++ memory allocation First i read whole file line-by-line in single string s. And my program got TLE11 many times. But when i wrote a single line: s.reserve(2000000); before reading of file, my program got AC 0.343. So if you want avoid TLE in similar problems, reserve memory beforehand (if it possible) when you using STL. Edited by author 21.02.2007 01:20 Re: Finally AC && Slow C++ memory allocation If you want predictable timing and memory allocation, avoid using STL at all |
|
|