How is this python code calculating large factorials so fast and without memory limit error?

Правка en1, от pritishn, 2020-10-13 22:49:58

Link to the problem : https://www.codechef.com/FCF32020/problems/PATHWAY
Link to the code : https://www.codechef.com/viewsolution/38865614

In this code , how can python compute factorials of (N+M) ( N+M is in the order of 10^5 ) so fast? Can anyone explain this ? How did the python interpreter optimize it ?

Теги #python

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pritishn 2020-10-13 22:49:58 408 Initial revision (published)