min() function in c++ [SOLVED]

Revision en2, by Muhammad2218, 2016-07-23 15:08:02

I was solving problem C. Circular RMQ. Then i faced a problem, at first i get Time limit exceeded Here!, So i think that i am wrong in something like the whole idea or a bug in the code so i spent hours to find this wrong and i found nothing. But when i removed the line return min(rmq(...),rmq(...)); randomly in rmq function and i put instead of it int p1 = rmq(...), p2 = rmq(...); return min(p1,p2); it actually works and get accepted here. So i think min() function go crazy or some thing when it have two recursive calls in it, am i right ? or there is another thing i don't notice ?

Thanks in advance.

UPD: Built-in min() function don't have this problem.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Muhammad2218 2016-07-23 15:08:02 92
en1 English Muhammad2218 2016-07-23 14:53:11 820 Initial revision (published)