Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя sumit93

Автор sumit93, 9 лет назад, По-английски
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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится

Автор sumit93, 9 лет назад, По-английски

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?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

Автор sumit93, 10 лет назад, По-английски

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)?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор sumit93, 11 лет назад, По-английски
  • Проголосовать: нравится
  • -36
  • Проголосовать: не нравится

Автор sumit93, 11 лет назад, По-английски

Give me some idea to learn bitmask dp.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -10
  • Проголосовать: не нравится

Автор sumit93, 11 лет назад, По-английски
  • Проголосовать: нравится
  • -19
  • Проголосовать: не нравится