Why is this faster?

Правка en1, от padfoot1717, 2020-07-18 05:06:57

Friends during the previous contest (656 div-3) for problem-1385D - a-Good String i had submitted this solution 87151676 and it gave TLE, after looking at the model solution in the editorial i changed my normal "string" argument to "const string&" argument in the function that i had written and submitted this solution 87188378 which got easily accepted. Can anyone please explain the reason because of which such huge difference in execution time came just by changing the "string" argument to "const string&" argument"?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский padfoot1717 2020-07-18 05:06:57 562 Initial revision (published)