Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

### sumit93's blog

By sumit93, 5 years ago, ,
My code

LLI rec(int room,int col)
{
if(room==0&&col==0)
return 1;
if(room==0||col==0)
return 0;
LLI &ans=dp[room][col];
if(ans!=-1)
return ans;
ans=0;
for(LLI i=1; i<=room; i++)
{
LLI temp=nCr(room,i)%mod;
temp=(temp*rec(room-i,col-1))%mod;
ans+=temp;
ans=ans%mod;
}
return ans%mod;
}


I am using this recursive dp to solve a problem.Suppose I have 200rooms and 35 colours. Here mod=1000000007. I have to colour every room using 35 colurs and every colour must be used.My function gives me wrong output. But I think it shoul give me correct otput. if room=200 and colour=35 , my function output: 872158314. But correct output shoul be : 35727139.Can anybody explain my logical bug in my function.

Read more »

• -11

By sumit93, 5 years ago, ,

Given two number N,M.Count the number of pair(i,j) such that LCM(i,j)=i*j.Here M,N<=10^9 and min(M,N)=10^6. How can I do this?

Read more »

• +6

By sumit93, 5 years ago, ,

I have n two dimensional points and some rectangle.For each rectangle I have to answer how much point is inside of that rectangle? How can I answer this with complexity log(n)?

Read more »

• 0

By sumit93, 6 years ago, ,

• -36

By sumit93, 7 years ago, ,

Give me some idea to learn bitmask dp.

Read more »

• -10

By sumit93, 7 years ago, ,

• -19