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.me/problemset/customtest
Why is there such a huge difference when strings are used?