Problem Description
Loading...
Problem Analysis
At first I didn’t derive it correctly
The editorial said it was a binomial coefficient
Struggled for a while and couldn’t see how to derive it
Then through Pascal’s triangle and this manually calculated relation
I found it satisfies f(n,m)=f(n-1,m)+f(n-1,m-1)
So it is just a binomial coefficient
After that, modulo for big numbers can also be written easily
cpp
| |
Problem link:【HDU】[1799] How Many Times Does It Loop?