Huge runtime difference in recursion involving strings in G++11 vs G++14

Revision en1, by Vicennial, 2017-03-15 12:20:01

I had to use recursion+strings for a problem in a contest and I stumbled upon this irregularity.

Sample Code 'A' with strings:

Using input=5
Results:
G++ 11 5.1.0 = 7987 ms, 2044 KB
G++ 14 6.2.0 = 889 ms, 1856 KB
------------------------------------

Sample Code 'B' without strings:

Using input=6
Results:
G++ 11 5.1.0 = 3026 ms, 2012 KB
G++ 14 6.2.0 = 2995 ms, 1868 KB

To test it yourself, head over to http://codeforces.net/problemset/customtest

Why is there such a huge difference when strings are used?

Tags c++ 11, c++ 14, bug, c++11 vs c++14

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Vicennial 2017-03-15 12:20:01 1303 Initial revision (published)