Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

unable to understand reason for TLE when complexity is same

Правка en1, от aryam_agarwal, 2024-06-21 13:30:58

I have been solving Problem C from Codeforces Round #885(Div. 2),1848C - Vika and Price Tags. Below code gets accepted but adding a little change to the calc function gives TLE,

Accepted Submission: 266686268 .....TLE: 266686665

I changed

return calc(b ,rem ) + q + q/2; 

to

 return calc(rem , b-rem ) + q + q/2 + 1; 

in the calc function and it is giving a TLE after this change even though the overall complexity remains the same. Can anyone explain the same?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aryam_agarwal 2024-06-21 13:30:58 589 Initial revision (published)