Strange Time Difference

Правка en3, от amirhoseinfar1385, 2025-01-05 02:57:28

Hello everyone! Today, I encountered a very strange problem with question e1. I have one submission which is this: [link] And another submission which is this: [link] The only difference between the two is in line 123 and it's a very small difference, but the first one is accepted in 1.8 seconds, and the second one in 6 seconds. There is a huge difference. I wanted to know if anyone knows the reason for this big difference; it doesn't make any sense at all. That line executes about 100,000,000 times. I know it's a lot, but it doesn't make sense to me that this change would add 4 seconds to my code. I want to know if there could be another reason or if that's really all there is to it.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский amirhoseinfar1385 2025-01-05 02:57:28 6
en2 Английский amirhoseinfar1385 2025-01-05 01:14:40 233
en1 Английский amirhoseinfar1385 2025-01-05 01:11:45 578 Initial revision (published)