Why is this faster?

Revision en1, by 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"?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English padfoot1717 2020-07-18 05:06:57 562 Initial revision (published)